zeroxoneafour / polonium

Autotile manager for Plasma 6

Home Page:https://zeroxoneafour.github.io/polonium/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Re-tiling issues

tvarsis opened this issue · comments

Before you make the issue, confirm that

  • You are running the master build from GitHub actions
  • You have read the FAQ and the usage instructions
  • You have searched pull requests and issues and have found none similar to your issue
  • This problem comes from a failure in the tiling system and not a missing feature

Describe the bug

The re-tiling shortcut woks sometimes, but most of the time it does nothing. Same happens when you connect/disconnect an external monitor with different resolution, leading to broken tiling which is hard to re-tile, even manually. Usually you would have to close and reopen windows to get it to tile correctly.

To reproduce

There are multiple ways to reproduce this one, but it would happen after a tiling state becomes broken and you would expect the "re-tile" shortcut to fix it, but it doesn't. One way is to have 3 windows tiled correctly and then connect an external monitor with different resolution than your laptop monitor, in the mode that you only have display output on the external monitor and not the laptop screen. Tiling will become broken, and re-tile shortcut does nothing.

Expected behavior

Pressing the re-tile shortcut should always force a re-tile of all windows on the active desktop to the selected tiled layout. Connecting or disconnecting an external monitor should also automatically force a re-tile of all windows on all desktops to avoid broken states. It seems to be in very rare cases where the re-tile shortcut actually works as expected.

Log output

Apr 25 10:27:22 hostname kwin_wayland[3340]: qml: Polonium DBG: Window org.kde.plasmashell hooked into script
Apr 25 10:27:22 hostname kwin_wayland[3340]: qml: Polonium DBG: Not tiling window org.kde.plasmashell
Apr 25 10:27:23 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  hooked into script
Apr 25 10:27:23 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  added
Apr 25 10:27:23 hostname kwin_wayland[3340]: qml: Polonium DBG: Adding window  to desktops
Apr 25 10:27:23 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:23 hostname kwin_wayland[3340]: qml: Polonium DBG: Window org.kde.plasmashell removed
Apr 25 10:27:23 hostname kwin_wayland[3340]: qml: Polonium DBG: Removing window org.kde.plasmashell from desktops
Apr 25 10:27:23 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:24 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  removed
Apr 25 10:27:24 hostname kwin_wayland[3340]: qml: Polonium DBG: Removing window  from desktops
Apr 25 10:27:24 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  hooked into script
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  added
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Adding window  to desktops
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  removed
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Removing window  from desktops
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Putting client firefox in tile QRectF(0, 0, 3840, 1600) with direction 2 on desktop {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: QRectF(0, 0, 3840, 1600) QRectF(4, 4, 3832, 1592)
Apr 25 10:27:29 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:30 hostname kwin_wayland[3340]: qml: Polonium DBG: Untiling window firefox on desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:30 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Untiling window firefox on desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Untiling window firefox on desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  hooked into script
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  added
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Adding window  to desktops
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Window  removed
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Removing window  from desktops
Apr 25 10:27:31 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:32 hostname kwin_wayland[3340]: qml: Polonium DBG: Untiling window firefox on desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:32 hostname kwin_wayland[3340]: qml: Polonium DBG: Rebuilding layout for desktops {"desktop":"adcd4030-a4ab-40d8-804d-22c28c4f96a9","activity":"cd987270-f2c0-4fea-aa74-bca2e2803dae","output":"DP-5"}
Apr 25 10:27:34 hostname kwin_wayland[3340]: qml: Polonium DBG: Window org.kde.yakuake hooked into script
Apr 25 10:27:34 hostname kwin_wayland[3340]: qml: Polonium DBG: Not tiling window org.kde.yakuake

Screenshots and videos

No response

Additional context

No response

I will add that this happens to me sometimes, but after pressing the retiling shortcut, if I use another shortcut to move the window, it will get back into a tile (shortcuts like the polonium one for insert into or the kwin shortcut for move one screen to the left/right)

@zeroxoneafour Added logs now. The logs are for a scenario where I have one Firefox window tiled to the left (half screen) and adding a new Firefox window that then opens in full screen mode getting placed over the other FF window. Then I try to press Retile shortcut, but nothing happens. Expected result is for it to auto tile directly on open, but if that does not work, then the retile should sort it out. Not even trying to manually tile, drag or using "insert" shortcuts. Seems like it has a tendency to get into broken state where it is not possible to retile, but you would have to basically close and reopen all window. A "force retile all open windows" shortcut would be nice to have.

hey @tvarsis , just curious, but does Firefox seem to behave worse than others? I can't quantify it, but I feel like I always have more issues with Firefox than other applications - particularly when you create a new window by dragging a tab out of an existing window

@root-hal9000 Yeah, firefox and electron/flatpaks seems to work worst. But I gave up and switched to Krohnkite that have been updated for KDE 6 and works much better and more expected.

@zeroxoneafour any updates on this?
I can confirm both behaviours: invoking retiling shortcut having no effect, and firefox windows not being tiles appropriately. For latter, opening a non-firefox window (which can subsequently be closed) seems to usually make firefix windows tile.

Sometimes this does happen to me. I find that the fastest solution is quickly flicking between desktops. Unfortunately, I have not been using Linux much as of recent due to a wide variety of crashes, kernel panics etc. I also really doubt that an easy solution really exists for this problem.

I also really doubt that an easy solution really exists for this problem

Fwiw, the KDE 6 fork of krohnkite handles both the case of firefox as well as electron applications (which, in polonium, seem to always be floating) as expected. So the issue(s) seem to at least not be inherent to kwin on plasma 6.

Obviously the issue is inherent to kwin. There's no code in Polonium that checks if an application is firefox and decides to not tile it. There's no code in Khronkite that checks if an application is firefox and decides to tile it. It just happens that Khronkite manages its own tiles and Polonium relies on KWin to handle a lot of the tiling stuff. Theoretically, everything should work. In reality, Khronkite has a lot more fine-grained control over application sizing and tiling and doesn't have to believe in KWin's ability to move a window into a tile when told.

Polonium is deliberately an experiment to implement tiling on and fully utilizing the KWin tiling API, which is iffy more times than it perhaps should be. If Khronkite works better for you, then use it.

Thank you for the elaboration. It seems, then, the issue is with kwin's tiling API (which polonium relies on more so than krohnkite).

Are you aware of open issues and/or bugs reported to kwin regarding this? If not, given your intimate knowledge of polonium internals, could you please report the issue upstream and share the bug reference?

This problem comes from a failure in the tiling system and not a missing feature

I'm not 100% convinced this is properly a bug, rather than a missing feature. The default "re-tile" keyboard shortcut for Polonium is labeled in the settings window as affecting only the current window (it actually toggles tiling for the current window). I think it would be more accurate to say this is a request for a new feature, specifically a "re-tile all windows (on current virtual desktop)" shortcut. The real question is whether that's possible using kwin's current tiling API.