Jazqa / kwin-yakts

An easy tiling script for KWin
GNU General Public License v2.0
368 stars 20 forks source link

Desktop grid breaks script #21

Closed Fothcrah closed 4 years ago

Fothcrah commented 7 years ago

After opening the desktop grid and changing to a different desktop, the present windows keep their designated places, however, new windows stay afloat and don't respond to keyboard shortcuts. Tested on three different computers and configurations, the responses were slightly different -

Arch (AUR): The script stops working altogether, previously opened windows float. The problem is generally fixed by closing all but three or less windows and restarting the script. If three or less windows stayed open while restarting, opening a new window tiles them all on Desktop 1, assigning them to new desktops allows the script to continue working. If four or more windows were open upon restarting, opening a new window will tile four of them on Desktop 1, the newly opened window doesn't tile and every open window will float - the script seemingly ceases operation.

Manjaro (AUR): All previously opened windows keep their positions and snap back into place when moved, however, newly opened windows float and don't respond to keyboard shortcuts. The problem is fixed by closing all windows and restarting the script.

openSUSE Tumbleweed (GIT): All previously open windows float, GTK windows start flickering when moved as if their contents weren't being updated properly - maximising fixes the latter, could be unrelated. Restarting the script does nothing, the issue is only fixed by restarting the entire session.

Jazqa commented 7 years ago

I can't for the life of me reproduce this on my Fedora 26 laptop. The feature seems to work flawlessly. How many screens are you using on your computers?

Arch and Manjaro behaving differently is extremely weird, I wonder how the AUR package updates itself. I don't use Arch nor did I create or do I maintain the AUR package, which makes troubleshooting the AUR-package related issues difficult. I appreciate testing it on Tumbleweed as that confirms there's still an issue on the newest version. As soon as I get rid of the few nasty issues left, I'll start packaging the script to as many places as I can, including the KDE Store as well as versioning the releases.

Fothcrah commented 7 years ago

Single monitors for the Arch and Manjaro setups, dual screens on Tumbleweed. The latter two were borrowed for a brief period of time, so I won't always be able to thoroughly test or even actively use your script on those in the future, but I'll try to do my best.

If you'd like, you can study the PKGBUILD for the AUR package and contact its maintainer, should you find anything wrong. I'm no makepkg wizard and am terrible with code, so I can't exactly point any fingers there. I'll try reinstalling the script from GIT on Arch, see if that fixes anything.

As for Manjaro behaving differently from Arch - could be a difference in setups, as the KDE flavour of Manjaro comes bundled with a number of extras on top of the standard Plasma desktop. In addition, Manjaro packages do tend to lag a version or two behind Arch.

Jazqa commented 7 years ago

I've had zero luck reproducing this bug. Works wonderfully for me. Mind updating the script once again (on any of the systems), just to confirm the bug is still there?

If it was tell me which distribution you used to test it and I'll test it with a virtual machine of said distro.

EDIT: I've tried this with Manjaro with the script installed from AUR and it's working perfectly. I wonder what's different in our setups. It might be some tiny setting somewhere and the fix is probably really easy as soon as I'll find the cause.

maxigaz commented 7 years ago

I have the same problem under Manjaro using the AUR package as @Fothcrah described. I'm using a single monitor.

For now, the only thing I can add is that if I downgrade to version r141.4b70a9e (the same one as mentioned in the other bug report I made recently), all the misaligned windows on a virtual desktop are tiled correctly after I resize any of them or try to move it. With the latest version, I have to restart the script.

Edit: Another observation is that after the downgrade, the problem seems to occur less frequently.

Jazqa commented 7 years ago

Just to be sure, this is the feature we're talking about? I'm testing it on Manjaro using the AUR package as we speak and it seems to work. I've tried different layouts, handling a ton of desktops and creating & removing desktops via the grid and everything is working for me. I bet I'm missing something obvious. Sorry for the inconvenience, I'll find it eventually.

Also, is regular desktop switching working just fine? Desktop switching normally and via the grid should work the same way and call the same functions.

maxigaz commented 7 years ago

Just to be sure, this is the feature we're talking about?

Yes, that's the one.

However, I'm just realising I haven't mentioned a crucial bit of information (sorry about that): for me, the problem occurs when I drag one window to another virtual desktop inside the grid view. (When I first read OP, I thought that was what he/she meant.) In other words, just toggling the grid view and switching between desktops is fine, but moving windows between desktops is what tends to break things.

Jazqa commented 7 years ago

for me, the problem occurs when I drag one window to another virtual desktop inside the grid view

Thanks, I didn't know this was possible. I can reproduce it now.

Jazqa commented 7 years ago

Should work for moving windows between desktops now. I wouldn't use the grid for moving windows between screens though as it seems unreliable.

As a warning, I ended up rewriting a ton of crucial code so the newest commit might contain some nasty surprises.

maxigaz commented 7 years ago

I've just tried the latest version. Although if I move windows between virtual desktops too much, it still misbehaves/breaks eventually, it looks more stable at the moment.

Fothcrah commented 7 years ago

Just updated the script. So far simply opening the desktop grid and switching between desktops seems to work as intended. However, as @maxigaz mentioned, moving windows between desktops only seems to work half the time - sometimes a permanent gap is left where a window once was and if all windows are moved from one desktop to another, the now-empty desktop stops accepting new windows. In rare cases the script stops working altogether, closing all windows and restarting the script fixes it.

Tested on Arch (AUR), single monitor.

Jazqa commented 7 years ago

I've started using the desktop grid myself in order to fix all the issues, it's taking a while because I'm having hard time breaking the script. Both of the commits today should have increased the stability of the grid.

I've never used the grid before. Is moving between desktops and moving clients between the desktops all you use the grid for, or am I still missing some features?

billksun commented 7 years ago

Some other features of the grid that I use:

  1. Right-click on a window, and it will pin that window to all desktops.
  2. Click on any visible portion of the wallpaper on a desktop, drag it to another desktop. This will swap all the windows from the first desktop with the second.
Jazqa commented 7 years ago

@sib-null, I'll check out these features tonight and see if I'm able to fix them. I was not even aware of these features, thanks for pointing them out.

EDIT: Thus far, desktop grid has been functioning without any issues and all of the features @sib-null mentioned are working as well. Right-clicking on a window removes it from tiling purposefully, because tiling is desktop-specific and pinned windows are on every desktop. What kind of issues are you facing and can you think of anything that might cause the bug (would help reproducing it). Anyways, I'll keep using the feature and see if I stumble upon the bugs myself.

maxigaz commented 7 years ago

I've found a new issue about the desktop grid. Here are the steps to reproduce it in the latest git version:

  1. Have one of the desktops ignored by the script (in the settings, I have 5 under Ignored Desks).
  2. Open a window on the ignored desktop or move a window from a desktop where tiling is active.
  3. Move it to another one where tiling is active.
  4. The script seems to stop functioning completely on each desktop, so I need to restart it.

Also, the fields "Ignored Acts" and "Ignored Scrs" are both empty for me.

Jazqa commented 7 years ago

Desktop grid is one of the weirdest issues I've ran into. Most of the issues reported in this thread are functioning for me but not functioning for others. For example, @maxigaz, if I try to replicate the steps you just posted:

  1. A new window spawned on an ignored desktop and moved to a tiled desktop simply floats on the tiled desktop and the script keeps working.

  2. Moving a tiled window to an ignored desktop floats it on the ignored desktop and the script keeps working, when moved back to the original desktop, it gets tiled again.

What kind of distributions (KWin versions) are you guys running? Maybe I should try a virtual machine (using Tumbleweed myself).

maxigaz commented 7 years ago

I have KWin 5.11.2 under Manjaro Linux KDE Edition.

billksun commented 7 years ago

I have 2 configurations:

  1. A desktop with 2 monitors. Running on Manjaro KDE.
  2. A laptop running KDE 5.10.5 under NixOS.

On the desktop, the script is less stable, probably due to the dual screen. I'll file a separate bug for that when I can narrow down on some behavioral issues.

However, moving windows between desktops on both computers using the desktop grid can easily break the script.

Also, I make use of Plasma Activities, so that might be another reason why the script breaks so much. I'll do some experimentation on that end to see if I can narrow it down.

@Jazqa, how are you moving the windows? Using the shortcut key or desktop grid?

Jazqa commented 7 years ago

@sib-null, I'm moving the windows by dragging them to another desktop within the grid. I have three screens and I can move clients between the screens, desktops or both via desktop grid.

Activities are problematic but should not act up unless you move clients between activities and even then the client moved should simply float. It's been a while since I worked with the Activities, so I'll revisit them tonight and see if I can improve the stability.