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

Crashes on Windows 10 after system woke up from sleep #34

Open
keighrim opened this issue Jul 31, 2015 · 32 comments · May be fixed by RamonUnch/altdrag-1#1 or #133
Open

Crashes on Windows 10 after system woke up from sleep #34

keighrim opened this issue Jul 31, 2015 · 32 comments · May be fixed by RamonUnch/altdrag-1#1 or #133

Comments

@keighrim
Copy link

The app stops working after system sleep.
App icon in tray loses its white border and becomes not responding at all.

As a workaround, killing the task and re-run works.

@stefansundin
Copy link
Owner

I could not reproduce this. Does it happen every time?

Anyone else have this problem?

@keighrim
Copy link
Author

keighrim commented Aug 4, 2015

I actually installed Win 10 on my second laptop last night, and found this issue doesn't happen on that machine.
I'm trying to find what kind of conflict in the first device is causing this.

I'm closing this for now
I'll open another issue with more specifics, when I figure out what's the problem.

@keighrim keighrim closed this as completed Aug 4, 2015
@joserebelo
Copy link

I can confirm this still happens more often than not after the computer resumes sleep, on a laptop too.

@stefansundin stefansundin reopened this Aug 18, 2015
@sethbc
Copy link

sethbc commented Sep 18, 2015

Not sure if this is related (I very strongly suspect it may be), but windows 8.1 and windows 10 have some odd display re-sizing issues on sleep. I'm using 2x4k monitors and it constantly re-sizes open windows (e.g. chrome, explorer, etc.) when the monitors go to sleep. It has to do with a simulated display setting in the registry (specifically a mismatch in the simulated resolution when no monitor is detected I believe).

To reproduce the issue, you have to have a different resolution on the simulated desktop space (and it seems to me like changing the simulated resolutions have fixed the issue on my computer).

The relevant keys are under : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration

There are a couple of keys prefixed "SIMULATED..." and the relevant entries are a couple of other entries (00 and another nested 00). The names of the relevant keys are:

(in the first 00)
PrimSurfSize.cx
PrimSurfSize.cy

(in the nested 00)
ActiveSize.cx
ActiveSize.cy

if you change the keys to match your specific desktop resolution it seems to fix the issue. I'm not an expert in windows internals, but I'm guessing this is a failure case that @stefansundin hasn't been able to reproduce because he doesn't use a monitor that uses HDMI or DisplayPort (which are the only displays on which I've been able to reproduce the issue, any earlier connectors seem to function fine). I'm not sure if the SIMULATED displays are ever used absent HDMI/DisplayPort (again, this isn't my area of expertise!).

@sethbc
Copy link

sethbc commented Sep 20, 2015

Just wanted to briefly update - this doesn't seem to perfectly fix the issue, but it seems to occur much less frequently.

@joserebelo
Copy link

My computer doesn't have those keys in the registry, but the issue also happens when i connect a new screen, so it seems to indeed be related to the display settings.

@Rob-ot
Copy link

Rob-ot commented Oct 23, 2015

I'm also having this issue. I'm on a laptop with an external monitor. Along with the crash I see other issues (unrelated to AltDrag) when the monitors turn off like my windows all getting moved to the top left of my screen.

Is there a crashlog or any other information I can provide?

@stefansundin
Copy link
Owner

AltDrag does not have a crashlog, unfortunately.

Do the DPI scaling change around the same time AltDrag is crashing?

@Rob-ot
Copy link

Rob-ot commented Oct 23, 2015

It might yeah, my primary screen (external monitor) is a normal screen and the laptop has a retina screen, so when it's turning off screens it may report one value vs the other.

@joserebelo
Copy link

With only the laptop monitor, if I change the dpi from 100% to 125% AltDrag will crash, yes.

@keighrim
Copy link
Author

I was able to resolve this issue by setting DPI using control panel (not through windows settings universal app)

@joserebelo
Copy link

Can confirm, the dpi was set to 125% in the control panel, even though it was set to 100% in the universal app. This solved the AltDrag issues, plus some mouse/keyboard problems I had when resuming from sleep and connecting displays (I think were related to AutoHotKey, having the same cause).

@tuok
Copy link

tuok commented Jan 13, 2016

I'm still having this issue with AltDrag v1.1. I'm using a Windows 10 laptop with two attached 1920x1200 screens (one in landscape orientation, one in portrait mode). DPI scaling is set to 100% (Change the size of text, apps, and other items). Any update on the issue?

@keighrim
Copy link
Author

@tuok From your description, I think you have set DPI in the universal settings app (which is triggered by pressing Win+I or select "All settings" from notification center. Why don't you try setting DPI using control panel (right click on start -> "Control panel" -> "Display" -> "set a custom scaling level" (in the middle of the text in upper center) ).

I'm not sure if it does matter to sync both DPI, but I have set them (from universal app and control panell) synced to 100%, and the issue has gone ever since.

@tuok
Copy link

tuok commented Jan 13, 2016

@keighrim Thanks for your suggestion, but unfortunately custom scaling level in Control Panel was already set to 100%.

I just started to investigate the issue, so I'm not sure when and how the problem exactly appears. I tried to reconnect both external monitors, but it didn't make any difference, at least for now.

@SgtGrumbles
Copy link

I'm also having this problem. I suspect my issue is related to sethbc's. I have a high resolution screen (3840 x 2160) connected by DisplayPort, and Windows often does weird resizing & position of windows when the computer returns from sleep.

I tried the registry setttings but it doesn't resolve the issue, unfortunately. Windows still get re-positioned and resized (not AltDrag's problem, obviously), and AltDrag stops working.

@nevion
Copy link

nevion commented Jun 30, 2016

I have the problem - for several weeks, I think it also happens after screen lock - and I definitely see it on resume, though I frequently connect/disconnect mini displayport.

As a work around, I do taskkill as admin, then restart it manually as admin... really hoping you're able to figure it out soon.

@Brog33
Copy link

Brog33 commented Jul 28, 2016

I have this issue every day now for weeks and it's getting really annoying. I have to go in the task manager and kill altgrab and then restart it every time the computer goes into power saving.

Any news on this issue?

@patricknelson
Copy link

I get this issue regularly just when my monitor configuration changes (but it's not always easily reproducible). I'm on Dell Precision 5510 with a Dell USB-C WD15 dock. Simply unplugging the thunderbolt 3 (USB-C) and plugging back in will cause it to gray out. I do have a 4K display on my laptop and sometimes I wonder if the temporary flashing into 4K resolution (scaled up) back down and etc (even on the main laptop monitor as I don't utilize full resolution) has something to do with it.

It's easy to tell if it crashed too by looking at the icon. I tried to get it to crash with no luck, so I'll post screenshots later when it happens again!

@patricknelson
Copy link

patricknelson commented Dec 2, 2016

Ok, I was finally able to reproduce it consistently. I believe I have traced it down scaling in Windows 10. See the Settings area (Windows + I), then go to System -> Display and under "Change the size of text, apps and other items". If you adjust it that, AltDrag will instantly crash 100% of the time.

This has become a common enough issue for me to create a quick batch script for it to restart AltDrag:

@echo off
taskkill /F /T /IM AltDrag.exe
start "" "C:\path\to\AltDrag.exe"

Screen capture:
2016-12-02_14-40-30

@ahernsean
Copy link

I still experience this same issue when waking from sleep (generally after attaching or detaching from other monitors). Have to kill the AltDrag process and manually restart it.

@jgraden
Copy link

jgraden commented Mar 26, 2019

For reference, still experiencing this on Win10 with AltDrag version 1.1. Script by @patricknelson works well to resolve, embedded as AHK hotkey. Still, AltDrag remains one of the best little tools I've come across - thanks @stefansundin . :-)

@jdnixx
Copy link

jdnixx commented Nov 24, 2019

For reference, still experiencing this on Win10 with AltDrag version 1.1. Script by @patricknelson works well to resolve, embedded as AHK hotkey. Still, AltDrag remains one of the best little tools I've come across - thanks @stefansundin . :-)

Can you share your AHK script that launches this? Do you mean you set it up on an actual hotkey combo (like win+alt+A or something like that?) Right now I have just a "restart_altdrag.bat" file on my desktop with @patricknelson's script, wondering if there's a way to automate it upon the laptop waking up.

@garoto
Copy link

garoto commented Nov 25, 2019

wondering if there's a way to automate it upon the laptop waking up.

@jDally987 you can create a "Scheduled Task" that activates when resuming from sleep: https://superuser.com/a/149924

@Remington012
Copy link

Just FYI, I'm hitting this issue as well. If I have my external display connected, and walk away from my laptop for long enough for the monitor to turn off (and hence for the desktop to lock), then upon returning/unlocking, AltDrag is non-functional and the system tray icon is black.
Killing & restarting AltDrag when it occurs seems to be my only choice at the moment.

@RamonUnch
Copy link

I fixed this problem on my fork.
https://github.com/RamonUnch/AltDrag
The problem was related to tray icon:
In some cases when resuming from sleep mode under windows 10 DPI scaling changes, ad when it changes, AltDrag recieves the WM_TASKBARCREATED message. AltDrag in this case will try in an infinite loop to restore his tray icon. Because the tray icon is still there it is not possible and AltDrag is stuck.
The fix is easy, you just need to modify the loop in UpdateTray() function.

@pablospe @warnerAWESOMEmoore and @benley This should also fix your issue #107 with screen resolution change.

@pablospe
Copy link

pablospe commented Feb 8, 2021

Great! Thanks a lot! Is there a Pull Request of your code for this repo? I would say many people won't know about your independent changes, and it would be nice to merge your great changes to the main repo.

@RamonUnch
Copy link

The code is very heavily modified and completely refactored. I made a separate repositorry
Stefan Sundin is really no more working on this project, not even to the point of merging any pull request anyway. Look at celynw pull request about fixing Win10 invisible border bug.
dsjstc proposed Stefan to push my fork on the readme.md or the official page but, I think Stefan has really no more time for this project.

@ahernsean
Copy link

ahernsean commented Feb 8, 2021 via email

@FSund
Copy link

FSund commented Feb 8, 2021

If Stefan has abandoned AltDrag he could transfer the repo to Ramon or perhaps add a link to Ramon's version.

@pablospe
Copy link

pablospe commented Feb 8, 2021

Maybe an AltDrag organization could be created and all the contributors can help to move this project forward. Also people for reviewing code, etc., so it is not only one. So the repo would be something like:
github.com/altdrag/altdrag
(and the contributors to have access to it)

@RamonUnch
Copy link

If anyone wants to participate to my fork, he is welcome to submit pull requests.
I always worked alone and am not a professional programmer, I am not sure I could handle several contributors.
With my job, and the current situation, the time I can allocate to the project is very random.
I took this project because the original AltDrag was not usable for me and yet it implemented a feature that is mandatory.
Originally I just fixed the code for myself, then I made it public because I saw really no one would work on this again unless I do it myself. In general will try to focus on bug fixing instead of new features, because I do not need new features.

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