RamonUnch / AltSnap

Maintained continuation of Stefan Sundin's AltDrag
GNU General Public License v3.0
1.91k stars 60 forks source link

Feature Request : Alt-Move snapped windows together #507

Open shodanx2 opened 4 months ago

shodanx2 commented 4 months ago

Here is a visual example

https://github.com/RamonUnch/AltSnap/assets/10621885/8d26a552-9f17-4a34-87d0-26be956b4d97

AltSnap does a great job of snapping windows together.

Of course snapped windows are just adjacent touching windows, not actually snapped.

So I suggest that when Alt-moving a window, check if any there are other hWnd ending exactly the next pixel outside the Alt-moved window.

One way could be to list all hWnd, get their windowrect, and check if any of their borders correspond exactly to the next pixel outside our window.

Another method could be using WindowFromPoint to check 1 pixel around our window and see if any other window are present. If yes, check that their edged is exactly ending at the border of our window and not merely overlapping.

This could be made efficient by checking say, only 1 out of 50 pixels on the perimeter instead of every pixel on the window perimeter. As it is unlikely that a window less than 50 pixel would be snapped (probably a very very rare case)

shodanx2 commented 4 months ago

Oops, in my video, I grabbed it by the titlebar, imagine that I alt-moved it !

RamonUnch commented 4 months ago

I thought about this group moving feature, but I never actually implemented it, not that it is hard or anything, but I have less and less time to invest into AltSnap.

shodanx2 commented 4 months ago

Maybe AltSnap users could collectively fund you to delegate some dev tasks for wanted features ? I'd certainly chip in 20$ for this.

Which is not enough to edit one text file, but if like, 30 people do, that would probably be enough some an enthusiast fiverr.com dev to take care of ?

That said, AltSnap is awesome as it is already, this and the other things would be a little cherry on top !