Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alt-drag stops working when displays change (Windows 10) #76

Open
daveola opened this issue Feb 24, 2017 · 36 comments · May be fixed by #133
Open

alt-drag stops working when displays change (Windows 10) #76

daveola opened this issue Feb 24, 2017 · 36 comments · May be fixed by #133

Comments

@daveola
Copy link

daveola commented Feb 24, 2017

On Windows 10 if I plug in or remove displays, alt-drag no longer functions.

The tray icon becomes black (both the cursor and the arrows) and will not respond to right clicks.

Using taskmgr to kill the process and restart it is the only workaround I have found.

@daveola daveola changed the title alt-drag stops working when displays change (Windows 10) BUG alt-drag stops working when displays change (Windows 10) Feb 24, 2017
@daveola
Copy link
Author

daveola commented Feb 24, 2017

Version 1.1

@heathkit
Copy link

heathkit commented Mar 7, 2017

Also seeing this

@sparebytes
Copy link

This also happens if I change the DPI scaling on any of my monitors.

@theperm
Copy link

theperm commented Apr 12, 2017

I think this is related, but when i resume my windows 10 laptop from sleep the same issue happens. Probably because screens begin to be re-initalised due to using a docking station or a deeper sleep mode.

@Brog33
Copy link

Brog33 commented May 4, 2017

Just to add: After I installed the Windows 10 Creator Update AltDrag keeps stopping after the PC has been idle for some hours. I suspect maybe some power managment stuff kicking in that affects it.

@sethbc
Copy link

sethbc commented May 7, 2017

duplicate of #34

@tihz
Copy link

tihz commented Oct 23, 2017

As workaround I create a .cmd script to relaunch altdrag and modified startmenu shortcut to point it

Here you are the script :

taskkill /f /im AltDrag.exe
start "" C:\Users\Anthony\AppData\Roaming\AltDrag\AltDrag.exe

@sparebytes
Copy link

sparebytes commented Oct 23, 2017

@tihz, I did the same thing. I even used Windows Task Scheduler to run it every time I unlock my computer because I usually run into issues after waking my laptop up from sleep.

@tihz
Copy link

tihz commented Oct 24, 2017

@sparebytes Very good idea ! Thanks for the tip :)

@anodynos
Copy link

anodynos commented Nov 9, 2017

@sparebytes I am trying to create a Task Scheduler on Windows 10, it gives me headaches.

It runs only the first part, killing the existing one, but it never starts the new one?

Any tips?

@patricknelson
Copy link

Yeah, I had a similar solution to this back in 2016 #34 (comment). Seems @stefansundin hasn't touched this now in well over a year (soon to be 2 years). Even checking "Override high DPI scaling behavior" under compatibility tab (in the properties screen for Windows 10) doesn't have any effect.

An alternative fix would be to find a way to prevent Windows from unhelpfully temporarily scaling then un-scaling when you switch displays, open the laptop, wake from sleep (etc) simply because you prefer not to run at the native 4k resolution (e.g. I run my laptop screen at 1080p due to general scaling issues, but it can't help but scale itself to 4k, even temporarily, whenever you attach a new monitor)

@Finomosec
Copy link

On Windows 10 if I plug in or remove displays, alt-drag no longer functions.
The tray icon becomes black (both the cursor and the arrows) and will not respond to right clicks.
Using taskmgr to kill the process and restart it is the only workaround I have found.

Same thing here.
Running on Windows 10 Pro (64bit).
Version 1.1

@stefansundin are you still working on AltDrag?
If you fix this i will donate something :-) I really like AltDrag <3

@patricknelson
Copy link

I'll chip in $20 (already donated one before but I can do it again). This is basically essential software for me these days.

@ahernsean
Copy link

ahernsean commented Jan 16, 2019 via email

@daveola
Copy link
Author

daveola commented Mar 14, 2019

I can't just do a simple bat script because I have to run altdrag with elevated permissions, so I'd need some sort of elevated kill/restart as well. I'd happily chip in $20 to get this fixed as well.

@sparebytes
Copy link

sparebytes commented Mar 14, 2019

I found another solution. Now I just use a modified AutoHotKey script. It doesn't do everything AltDrag does and I have to start it myself every time I reboot but I haven't had any issues.

The original script is here and uses the left alt key: https://autohotkey.com/docs/scripts/EasyWindowDrag_(KDE).htm

My script is attached and uses the windows key.
WindowDragging.ahk

edit: PS. I'm thankful to @stefansundin for making this and donated a long time ago even knowing the issues. It's probably not worth his time to work on this. Maybe we should buy him a 4k monitor to give him good reason to fix it 😆

edit 2: Fix dyslexia

@daveola
Copy link
Author

daveola commented Mar 18, 2019

@sparebytes Thank you, thank you, thank you.

It hadn't occurred to me to use AHK. Very nice.

@MattSturgeon
Copy link

It doesn't do everything AltDrag does and I have to start it myself every time I reboot but I haven't had any issues.

If you compile the script to a standalone exe it should be possible to copy it to your autostart folder here %appdata%\Microsoft\Windows\Start Menu\Programs\Startup

@krizajb
Copy link

krizajb commented Sep 2, 2019

Yes, I've tried many AHK scripts, none of them work as needed. Some don't even support dragging to another screen and bump into screen "border". Same goes for the one you posted, it resizes the window when switching the screen.
Main screen (250%):

image

Dragging to extended screen (175%):

image

@Chematronix
Copy link

Alt-drag stops working sometimes for me, or worse, it leaves the modifier key pressed, wrecking chaos on my desktop (possible conflict with AHK?).
Sparebytes' suggested script works a treat though, even dragging through extended desktops; even though it's 14 years old!
BTW, you can place the .ahk in your Startup folder, or even better, a shortcut. No need to compile into an .exe.

@jdnixx
Copy link

jdnixx commented Jan 28, 2020

Same problem here. I've had it for a long time actually. Black tray icon when I disconnect from my eGPU, and display scaling switches from 100% (on the external monitor) to 125% (on my laptop display).

I've used a .bat as others have suggested for a while now, but even that doesn't work to kill the dead altdrag process sometimes. The script is:

@echo off
start /b /wait taskkill /F /T /IM AltDrag.exe /FI "status eq running"
start "" "%appdata%\AltDrag\AltDrag.exe"

Maintaining altdrag & its quirks has taken up so much of my time & energy lately (& for quite a while honestly) that I've wondered if there's an AHK script that can really replace its functionality completely, as I've been tweaking the crap out of my PC setup with ahk to the point where it's more essential than even altdrag for me nowadays (although altdrag is still the very important yang to ahk's yin). I might try the one posted here but I wonder if there are better ones that aren't 14 years old.

EDIT: oh and as far as elevating the "restart_altdrag.bat" script with admin privileges, the solution for me was to make a shortcut to the .bat on my desktop, right click and Properties..., and in Advanced (I think under the Compatibility tab) check "always run as administrator". That way, running it from that shortcut instead of the actual .bat will always elevate it, and I also then bound the shortcut to Win+Z using AHK. So pretty much anywhere anytime I can "reset" altdrag completely by quickly mashing Win+Z, ALTHOUGH like I said sometimes it still fails to kill the dead process anyway, and in an unrelated error to altdrag itself, it seems DPI changes sometimes kill the AHK process as well, rendering my handy keyboard shortcut useless, until I manually reload my main system-wide AHK script 😡 No idea how Microsoft botched up things so badly with something as weird and innocuous as unplugging a display with higher dpi. But ugh what a mess.

@Chematronix
Copy link

I might try the one posted here but I wonder if there are better ones that aren't 14 years old.

Why not, you know, Just Do It©? Would take less time than typing that post!

My only grievance with EasyDrag is that it doesn't work reliably with the Windows key, but that's Windows (key, system and philosophy) for you. It works a treat with Alt though.

@jdnixx
Copy link

jdnixx commented Jan 28, 2020

Why not, you know, Just Do It©? Would take less time than typing that post!

Lol i'm not nearly experienced enough at AHK scripting to undertake something like that. Much better at writing long diatribes than grokking all of AHK's crazy functions and syntax differences between versions

@Chematronix
Copy link

Chematronix commented Jan 28, 2020 via email

@patricknelson
Copy link

Those scripts are pretty good; they do miss some features that AltDrag has, but the scripts provide a really great starting point. Would be great to see (from my perspective/usage), otherwise AltDrag is still more "profitable" (so to speak)

  1. Drag when full screen (e.g. "restore" window and, if moved to top slowly or if moved quickly, remaximizes)
  2. Double click to maximize
  3. Cursor changing to provide feedback that dragging/resizing has begun
  4. Drag to edge to fill half screen (emulating aero snap)

@jdnixx
Copy link

jdnixx commented Jan 29, 2020

@Chematronix , you sparked my interest, on some quick googling I found the second script in this post (second to last reply) works extremely smoothly, way better than the KDE-style one you suggested; maybe by combining the two we could get a really workable script.

Still no snapping, which is a must for me at least... and stuff like mouse4 and mouse5 but I'm sure those could be added in pretty easily. Like @patricknelson said it's a good starting point

EDIT: also didn't realize stefan has a list of similar programs including like 5 AHK scripts right on his site:
https://stefansundin.github.io/altdrag/doc/other-programs

@Chematronix
Copy link

Chematronix commented Jan 30, 2020 via email

@jdnixx
Copy link

jdnixx commented Jan 31, 2020

maybe by combining the two we could get a really workable script.
Someone beat you to it: http://corz.org/windows/software/accessories/KDE-resizing-moving-for-Windows.php

Oh interesting. Have you tried it, does it work the best out of all of them?

@Chematronix
Copy link

Chematronix commented Jan 31, 2020 via email

@chrisdtaylor
Copy link

I had been using a .bat script to restart alt-drag after resolution changes would cause it to stop functioning. This other script (corz.org) doesn't suffer from that issue and provides all the goodness I got out of alt-drag.

Thanks for finding and sharing that!

@lpers
Copy link

lpers commented Feb 19, 2020

maybe by combining the two we could get a really workable script.
Someone beat you to it: http://corz.org/windows/software/accessories/KDE-resizing-moving-for-Windows.php

The link seems to be dead unfortunately at the time of writing this comment, anyone able to upload this anywhere else?

@EduardoSantanaSeverino
Copy link

I personally only use the alt drag, I am not using any more features aside from alt drag.

So for me, the script illustrated by Chematronix worked like a charm.

I meant why not try the script that has been working (mostly) flawlessly for 14 years: 1. Download and install https://www.autohotkey.com/ 2. Download (save or rename to .ahk instead of .txt) and execute 1. EasyDrag (Alt key): https://www.autohotkey.com/docs/scripts/EasyWindowDrag_(KDE).ahk (prevents using the mouse while doing Alt-Tab) 2. EasyDrag (Win key): https://github.com/stefansundin/altdrag/files/2968332/WindowDragging.ahk (sometimes opens the Start Menu instead, at least on my system). 3. Profit! 4. If you like it and want it to start automatically, create a shortcut in your Start Menu\Programs\Startup folder (%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup) That's it, no AHK hacking required. :) Edit: Email replies break horribly here, fixing... and another minor gripe: you can't Alt-drag a maximised window. But you can double-Alt-RMB to restore, and immediately drag with LMB! (double-Alt-LMB minimises, double-Alt-MMB closes!)

@RamonUnch
Copy link

@EduardoSantanaSeverino I fixed this problem on my fork in v1.34.
https://github.com/RamonUnch/AltDrag
The problem was related to bad tray icon handeling, and this issue is the is the same than #107 and #34.

@chrisdtaylor
Copy link

@EduardoSantanaSeverino I fixed this problem on my fork in v1.34.
https://github.com/RamonUnch/AltDrag
The problem was related to bad tray icon handeling, and this issue is the is the same than #107 and #34.

@RamonUnch, can you provide instructions on how to build your fork?

@chrisdtaylor
Copy link

maybe by combining the two we could get a really workable script.
Someone beat you to it: http://corz.org/windows/software/accessories/KDE-resizing-moving-for-Windows.php

The link seems to be dead unfortunately at the time of writing this comment, anyone able to upload this anywhere else?

The link is working great for me at this moment.

@RamonUnch
Copy link

RamonUnch commented Jan 20, 2021

@chrisdtaylor

can you provide instructions on how to build your fork?

I make the releases builds using mingw64-32b. Just install it and run mk.bat
Builds are available at https://github.com/RamonUnch/AltDrag/releases
Please sibmit any issue over there... at https://github.com/RamonUnch/AltDrag/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.