nclarius / tile-gaps

KWin script to add space around windows touching a screen edge or other window
https://store.kde.org/p/1619642
GNU General Public License v3.0
104 stars 16 forks source link

Weird delay with gaps when using keyboard shortcuts #8

Closed TonyTwoStep closed 2 years ago

TonyTwoStep commented 2 years ago

This wasn't happening in the version I had installed prior to this, though admittedly that one was a few months old.

I can record the behavior if you're unable to reproduce it on your end

nclarius commented 2 years ago

I can't reproduce the issue, and would need to look into the logs to figure out what might be the problem. Could you please do the following:

  1. Open a terminal and run journalctl -g tilegaps -f > tilegaps.log; don't close the terminal yet
  2. Trigger the bug
  3. Go back to the terminal and press Ctrl+C
  4. Upload the contents of the file ~/tilegaps.log. This log will contain the captions of the windows you have open, so make sure you have no sensitive information in window titles while you record into the log file.

In addition, do you have any other KWin scripts enabled?

A screencast might also be helpful if the effort is feasible.

Thanks!

TonyTwoStep commented 2 years ago

Here's the contents of that log after re-creating the issue:

Feb 13 16:17:26 AD-PC kwin_x11[18403]: file:///home/anthony/.local/share/kwin/scripts/tilegaps/contents/code/main.js:57: TypeError: Cannot read property 'caption' of undefined
nclarius commented 2 years ago

Oh sorry, it appears I had a non-functional version uploaded. In the file it complains about, change l. 56 client.caption || client to client ? client.caption : client, restart KWin with kwin_x11 --replace & or kwin_wayland --replace & and try again.

TonyTwoStep commented 2 years ago

Hey so I made that change, restarted the kwin process, etc. and the error in the log is now no longer present. However, the issue does remain and is actually now not logging anything at all to the log file.

I'm going to attach a clip of the issue

https://user-images.githubusercontent.com/43851175/155013777-b00570a2-76f8-445b-9694-e79e2b1cd321.mp4

Here you can see that when dragging the window to the edge of the screen, the gaps work as expected, but when using the keyboard shortcuts, they don't. I've noticed that when opening a system menu or launching another application will cause the gaps to then be applied. You can see me launch KRunner which causes the Konsole window which previously didn't have any gaps, to apply gaps. Also, I've started logging during the video capture as well, where no errors were found (I cat and open the log file in vim at the end of the capture)

Let me know if you need any other info/have any other questions or if this issue seems specific to my setup rather than your kwin script. Thanks a bunch

nclarius commented 2 years ago

Thanks for the detailed report, I think I understood the problem. I just released an update that might fix it, though I'm not sure since I can't reproduce the bug in the first place. This one should also produce a non-empty log, in case the problem isn't solved yet. Can you please test with the newest version?

TonyTwoStep commented 2 years ago

Can confirm that after installing v6.12 and restarting/reconfig kwin, the issue has been resolved.

Thanks so much for the stellar support and maintaining this great package.