Problem witih "framerate" when dragging windows with AHK

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Coldblackice
Posts: 29
Joined: 13 Nov 2013, 14:39

Problem witih "framerate" when dragging windows with AHK

20 Sep 2020, 20:32

I use an AHK script "KDE Window Drag" which enables moving/resizing windows (in Windows) by mouse click-and-dragging anywhere inside a window instead of having to click-and-hold the window's title bar (for moving) or the razor-thin window borders (for resizing).

The script works, however, the visualization is choppy/stuttery, as if it's running at a much lower framerate/FPS than doing this natively with Windows. When I move or resize using the standard Windows functions, it's a smooth 164Hz animation.

I've wondered if Windows utilizes some native API DWM function for moving/resizing windows whereas this AHK script more or less is doing a bunch of repeated micro actions, limited by a polling or "refresh rate" of Autohotkey (and its firing of actions).

Is there a way to have AHK mirror Windows visualization for this?
KDE Window Drag (Modded).ahk
(Mods by me)
(9.46 KiB) Downloaded 32 times
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: Problem witih "framerate" when dragging windows with AHK

21 Sep 2020, 15:48

Hi

Try replace:

Code: Select all

SetWinDelay,2
by

Code: Select all

SetWinDelay,0
or

Code: Select all

SetWinDelay,-1
(not tested)

A_AhkUser
my scripts
User avatar
Coldblackice
Posts: 29
Joined: 13 Nov 2013, 14:39

Re: Problem witih "framerate" when dragging windows with AHK

06 Oct 2020, 22:44

A_AhkUser wrote:
21 Sep 2020, 15:48
Hi

Try replace:

Code: Select all

SetWinDelay,2
by

Code: Select all

SetWinDelay,0
or

Code: Select all

SetWinDelay,-1
(not tested)

A_AhkUser
This worked perfectly! Setting this to "0" did the trick, thanks for that.

The only issue now is the resizing function: when resizing, the area of the newly-expanded area of window is blank/white until you let go of the resizing. It's like it's waiting for you to stop resizing before it redraws to fill in the space. When resizing a Windows explorer window using the default border-corner, the explorer window and its contents resize and adapt "live" while you do it, the contents of the window shifting and adapting to whatever shape of window you drag.

I know this isn't a huge functional deal, but might there be a way to mimic the default Windows ability to resize? I'm not sure why the window isn't immediately redrawing when using my AHK script's resizing function.

Thanks again for the help!
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: Problem witih "framerate" when dragging windows with AHK

06 Oct 2020, 23:10

In windows you want show window contents while dragging checked and that should fix your last issue.
Should be under Performance Options >> Visual Effects.
HTH

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: jollyjoe and 325 guests