emvaized / kde-snap-assist

KWin script for KDE Plasma which suggests other window thumbnails on snap
https://store.kde.org/p/1875687
GNU General Public License v3.0
97 stars 6 forks source link

Issue with using keyboard to enter quarter tiling #21

Closed r-flash closed 1 year ago

r-flash commented 1 year ago

First of all, thanks for this amazing script!

There is just this small issue with the (relatively new) KWin shortcut to enter quarter tiling. When you want to place the active window to, let's say, the top left quarter, you would normally press Meta and then hit Top and Left arrows in rapid succession. However, the Snap Assist is triggered right after pressing Meta+Top and the following Left arrow is not registered.

I don't know what kind of solution is feasible but maybe adding a small delay before triggering the Snap Assist would be enough?

emvaized commented 1 year ago

How, that's sounds reasonable. I suppose that adding default delay of 20ms could solve your problem, while not affecting regular usage so much.

I just added new config "delay before showing the assist" in the dev branch. Would be glad if you could test it! (installation guide)

r-flash commented 1 year ago

Thanks! I tested it but it doesn't really seem to do anything. I set it to 1000ms but it still appears instantly. Does it mean I did something wrong? However, I checked contents/ui/code/windows.js in my downloaded zip and it does include the setTimeout call from the latest change in the dev branch.

emvaized commented 1 year ago

It definitely should include that call. When I pushed the changes associated with this new option, I forgot to include it, and added it afterwards. Maybe you downloaded the zip file before I added the "missing method"? Please try to download the zip file again

r-flash commented 1 year ago

I double-checked and definitely have the latest commit. What is interesting is that when I went to ~/.local/share/kwin/scripts/kdesnapassist/contents/ui/code/windows.js, manually changed the code to:

                timer.setTimeout(function(){
                    onWindowResize(client);
                }, 1000); // changed to 1000 from delayBeforeShowingAssist

...and restarted KWin, it worked! So it might be a problem with the property? Maybe it's set to the default 20ms for some reason? Since the condition passes, it is not zero.

emvaized commented 1 year ago

Oh, it's my bad — I just specified this config as a bool type, when it obviously should be int. Should be working now!

r-flash commented 1 year ago

Works great now, thanks a lot for the quick responses!