Question

Edit: I would like the dragging to appear "smooth" -- the refresh rate of each docked window while dragging to stay above 15 frames per second.

I've written this AutoHotKey script to demonstrate the concept but the animation is far from smooth.

(For this demo script to work, you must open 5 copies of notepad and save the documents as XXX1 ... XXX5)

SetTitleMatchMode, 2

WinGetPos,x1,y1,w1,h1,XXX1
WinGetPos,x2,y2,w2,h2,XXX2
WinGetPos,x3,y3,w3,h3,XXX3
WinGetPos,x4,y4,w4,h4,XXX4
WinGetPos,x5,y5,w5,h5,XXX5
yy1:=y1

Loop
{
  xx1:=x1
  WinGetPos,x1,y1,w1,h1,XXX1
  If (x1<>xx1)
    moveAll()
}

return

moveAll()
{
  global
  WinMove,XXX1,,%x1%,%yy1%
  x:=x1+w1
  WinMove,XXX2,,%x%,%yy1%
  x+=w2
  WinMove,XXX3,,%x%,%yy1%
  x+=w3
  WinMove,XXX4,,%x%,%yy1%
  x+=w4
  WinMove,XXX5,,%x%,%yy1%
}

Can anyone either optimize this script or suggest a proven method? (Or even show that it can't be done.) If it needs to be written in another language, so be it. It appears that Windows is limiting the repainting of windows to a certain total number of repaints on screen per second.

Was it helpful?

Solution

As per the comments, SetWinDelay, -1 and SetBatchLines, -1 will make it smoother. I disagree with using SetWinDelay, 5, since we want the pause between two WinMoves to be as small as possible. Although probably not noticebale to the naked eye, -1 will minimize that pause.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top