gerritdevriese / kzones

KDE KWin Script for snapping windows into zones
https://store.kde.org/p/1909220
GNU General Public License v3.0
238 stars 14 forks source link

Fix logic for determining a window is moved #47

Closed trivoldus28 closed 11 months ago

trivoldus28 commented 11 months ago

Better logic for determining a window is actually moved, in which case the zone is set to -1. Otherwise if the window is not actually moved the zone is unchanged.

The problem is that for some applications (e.g., Chrome), simply clicking on the title bar (not dragging) the script is signaled that the window is "moving" and thus when the mouse button is released, its zone will be set to -1 regardless whether the window is moved or not. This patch creates a moved variable to track if the window is actually moved, and if not does not reset the window's zone.

trivoldus28 commented 11 months ago

Added more code to improve multimonitor support, which should fix issue https://github.com/gerritdevriese/kzones/issues/36.

The bug was that the "active screen" was set to whatever the mouse was on, so shortcuts moved windows to the screen the mouse is on instead of where the window is currently at.

gerritdevriese commented 11 months ago

Someone's on a roll 😉

trivoldus28 commented 11 months ago

I'm just personally motivated to be more productive haha. I just joined the bandwagon of using 4K 42" TVs as monitors and window management with these guys are a totally different beast than regular monitors. KWin scripting is also surprisingly fun :)