Firefox window is incorrectly restored by AHK Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
foltugokki
Posts: 4
Joined: 22 Oct 2021, 09:35

Firefox window is incorrectly restored by AHK

22 Oct 2021, 11:16

Hi!

Steps to reproduce:

1. Launch Firefox

2. Launch this script

Code: Select all

#w::
	WinRestore, ahk_exe C:\Program Files\Mozilla Firefox\firefox.exe
return
3. Hit WIN+D to show desktop

4. Hit WIN+W to restore Firefox



RESULT:
The Firefox window is restored and activated but redrawn only partially (including parts of the content and "chrome") until some action is performed by the user such as switching to a different tab. Very annoying.

Whereas, when I use ALT-TAB to activate Firefox (after minimizing it), the window is fully redrawn as expected.

Replacing WinRestore by WinActivate in the above script yields the same result.

ActivateFirefox.png
Screenshot
ActivateFirefox.png (38.98 KiB) Viewed 694 times
OS: Windows 10 21H1
AHK version: 1.1.33.10 (latest)
GPU: NVIDIA latest driver 472.12
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Firefox window is incorrectly restored by AHK

22 Oct 2021, 18:44

Code: Select all

#w::
WinActivate, ahk_exe firefox.exe
MouseGetPos, x, y
MouseMove, 10, 10
MouseMove, x, y
Return
foltugokki
Posts: 4
Joined: 22 Oct 2021, 09:35

Re: Firefox window is incorrectly restored by AHK

22 Oct 2021, 22:23

Thanks for the workaround but I really want a better fix. Meanwhile I got the same result with StrokesPlus. It must be a bug with Firefox.
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Firefox window is incorrectly restored by AHK  Topic is solved

23 Oct 2021, 06:45

Code: Select all

#IfWinExist ahk_class MozillaWindowClass ahk_exe firefox.exe
F3::
WinActivate
Gui, New
Gui, Show
Gui, Destroy
WinActivate
Return
#IfWinExist
foltugokki
Posts: 4
Joined: 22 Oct 2021, 09:35

Re: Firefox window is incorrectly restored by AHK

23 Oct 2021, 22:44

Thanks for the new code. I don't know how but it works! :bravo:
foltugokki
Posts: 4
Joined: 22 Oct 2021, 09:35

Re: Firefox window is incorrectly restored by AHK

24 Oct 2021, 10:09

Or not... It doesn't work correctly with more than one Firefox window. I should have said from the start that I'm using GroupActivate to cycle through one or more Firefox windows. The code in my original post, which uses WinRestore, was just for testing.

Nevertheless, after restarting Firefox and AHK, the graphics glitch is fixed for now. I'm sure it's just temporarily fixed and is caused by something like low memory or number of active tabs.
User avatar
mikeyww
Posts: 26882
Joined: 09 Sep 2014, 18:38

Re: Firefox window is incorrectly restored by AHK

24 Oct 2021, 11:17

Different question, different answer.

I think that this is a general windowing problem associated with Firefox.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: aitaixy, Anput, dangoscrub, doodles333, joedf, Nerafius and 122 guests