stefansundin / altdrag

:file_folder: Easily drag windows when pressing the alt key. (Windows)
https://stefansundin.github.io/altdrag/
GNU General Public License v3.0
1.42k stars 94 forks source link

Aero snap leaves gap around windows #146

Open Constant-M opened 2 years ago

Constant-M commented 2 years ago

im using windows 10 21H1 there's the gap shown in the screenshot on the sides and below the snapped windowshttps://i.ibb.co/wQ8c464/Screenshot-40.png

RamonUnch commented 2 years ago

This is a known issue https://github.com/stefansundin/altdrag/issues/38, there is an old PR that fixes it partially, I made more recently another PR that fixes all invisible borders https://github.com/stefansundin/altdrag/pull/136, However they have not yet been merged. Hopefully at some point Stefan will have time to merge them.

inxomnyaa commented 1 year ago

Wouldn't it be much easier for altdrag to just execute keyboard shortcuts for actually snapping the programs the way the system does it anyways? For example, execute Win-ArrowLeft for snapping to the left. that would likely prevent all the compatibility and sizing issues

RamonUnch commented 1 year ago

There is no documented interface to snap a window the native way, Microsoft did not bother to export the required functions. It would be possible to send the keys to trigger the snap shortcuts, but this would not behave very nicely with people that have overriden the default shortcuts plus it would be limited to the focused window and would not work on multi-monitor setups.

Nobody in their right mind would re-invented snapping if it was possible to use native snapping. Even FancyZones, developed by Microsoft reinvents again snapping in a similar fashion than AltSnap does (by using a property for restore flags). AltDrag uses an internal database to store restore dimensions but otherwise it is again the same thing.

I spent hours trying to find hacks to better interact with native snapping bu the best I could find was by resizing already maximized windows, and it does not work properly, the only reliable option I could find was to re-invent the wheel.