Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Re-tiling issues #157

Open
4 tasks done
tvarsis opened this issue Apr 22, 2024 · 12 comments
Open
4 tasks done

[Bug]: Re-tiling issues #157

tvarsis opened this issue Apr 22, 2024 · 12 comments
Labels
bug Something isn't working

Comments

@tvarsis
Copy link

tvarsis commented Apr 22, 2024

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

@tvarsis tvarsis added the bug Something isn't working label Apr 22, 2024
@zeroxoneafour
Copy link
Owner

@zeroxoneafour zeroxoneafour added the needs log I assume you forgot? label Apr 22, 2024
@root-hal9000
Copy link

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)

@tvarsis
Copy link
Author

tvarsis commented Apr 25, 2024

@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.

@zeroxoneafour zeroxoneafour removed the needs log I assume you forgot? label May 3, 2024
@root-hal9000
Copy link

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

@tvarsis
Copy link
Author

tvarsis commented May 10, 2024

@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.

@suhail-singh
Copy link

@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.

@zeroxoneafour
Copy link
Owner

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.

@suhail-singh
Copy link

suhail-singh commented Jun 5, 2024

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.

@zeroxoneafour
Copy link
Owner

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.

@suhail-singh
Copy link

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?

@jay-depot
Copy link

jay-depot commented Jun 7, 2024

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.

@Raven-002
Copy link
Contributor

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

I've added a restart engine shortcut (#180) and some other improvements. testing the behavior described in this thread, of opening 3 windows and then connecting an external monitor, the bugs still occur to me, but the restart engine shortcut retile all windows without a problem (from the testing i did)

You can try the version with all of my changes now here: https://github.com/Raven-002/polonium/tree/dev. Run make install and then relog or run kwin_wayland --replace (this will close all windows) or wait for the PRs to be merged

It is not the best solution, but it is a simple fix that solves almost all of the issues i had

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants