Bismuth-Forge / bismuth

KDE Plasma add-on, that tiles your windows automatically and lets you manage them via keyboard, similarly to i3, Sway or dwm.
https://bismuth-forge.github.io/bismuth/
Other
2.4k stars 94 forks source link

[Bug]: Broken on KDE 5.27 beta #473

Open rakbladsvalsen opened 1 year ago

rakbladsvalsen commented 1 year ago

Summary

Just as the title suggests, Bismuth is broken KDE 5.27 (beta).

Sometimes windows are not "detected" (or not tracked?) and bismuth is, in this case, useless. All keyboard shortcuts don't have any effect at all on windows, it's basically as if the extension was disabled.

When it does work everything is very buggy: some windows open in tiled mode, and some others open in floating mode. Windows opened in floating mode don't seem to be detected by bismuth at all, and "Toggle floating mode" doesn't re-tile them again.

This probably has something to do with the tilling changes introduced in KDE 5.27, but I'm not completely sure about this.

Steps to Reproduce

Just use bismuth on 5.27. I'm only using Tile Layout.

Expected behavior

No buggy behavior.

Screenshots

No response

Bismuth version

3.1.4

KDE Plasma version

5.26.90 (5.27 beta)

The platform KWin is running on

Wayland

Additional context

pacman -Q | grep plasma:

kdeplasma-addons 5.26.90-1
plasma-browser-integration 5.26.90-1
plasma-desktop 5.26.90-2
plasma-framework 5.102.0-1
plasma-integration 5.26.90-1
plasma-nm 5.26.90-1
plasma-pa 5.26.90-1
plasma-thunderbolt 5.26.90-1
plasma-wayland-session 5.26.90-1
plasma-workspace 5.26.90-1
plasma5-applets-netspeed 1.9-1.1
plasma5-applets-window-title-git 0.7.1.r0.gb785c0a-1.1
RobertBuhren commented 1 year ago

I´ 'm using bismuth on KDE 5.7 Beta with X11 and I don't see any bigger issues so far.

jkcdarunday commented 1 year ago

Can confirm that it's also broken on Plasma 5.27.0 (non-beta) using Wayland. All windows become resized to the full screen instead of being tiled.

jkcdarunday commented 1 year ago

So I played around with Firefox windows and observed the following logs and noted the actions/events that I did in square brackets:

[Opened Firefox]
Feb 17 03:29:38 [redacted] kwin_wayland[1600]: org.kde.bismuth: Client added: KWin::XdgToplevelWindow(0x555c17eff000)
Feb 17 03:29:38 [redacted] kwin_wayland[1600]: org.kde.bismuth: Oops! undefined: undefined.
[Created New Browser Window]
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: Client added: KWin::XdgToplevelWindow(0x555c1811f760)
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: onWindowAdded,[object Object]
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrange
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrangeScreen/finished,[object Object]
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: Client is ok, can manage. Bind events now...
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: onWindowChanged,[object Object]
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrange
Feb 17 03:29:44 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrangeScreen/finished,[object Object]
[Login Popup of a Firefox Extension Appears]
Feb 17 03:29:47 [redacted] kwin_wayland[1600]: org.kde.bismuth: Client added: KWin::XdgToplevelWindow(0x555c182ac080)
Feb 17 03:29:47 [redacted] kwin_wayland[1600]: org.kde.bismuth: Oops! undefined: undefined.
[Created New Window]
Feb 17 03:29:52 [redacted] kwin_wayland[1600]: org.kde.bismuth: Client added: KWin::XdgToplevelWindow(0x555c182b26c0)
Feb 17 03:29:52 [redacted] kwin_wayland[1600]: org.kde.bismuth: Oops! undefined: undefined.
[Created New Window]
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: Client added: KWin::XdgToplevelWindow(0x555c17ec9d40)
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: onWindowAdded,[object Object]
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrange
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrangeScreen/finished,[object Object]
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: Client is ok, can manage. Bind events now...
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: onWindowChanged,[object Object]
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrange
Feb 17 03:29:58 [redacted] kwin_wayland[1600]: org.kde.bismuth: arrangeScreen/finished,[object Object]

I notice that if I create enough windows, new windows start to actually get tiled. The main culprit seems to be the Oops! undefined: undefined. error right after the "Client added" event.

Looking at the code, it seems that the ff. line might be the one throwing the error as the "onWindowAdded" message which should be the first line of the onWindowAdded function call below it is never logged. https://github.com/Bismuth-Forge/bismuth/blob/ef69afe69f615149ab347e4402862ee900452a65/src/kwinscript/driver/index.ts#L167

This .add function seems to be calling the constructors of DriverWindowImpl and EngineWindowImpl that mostly reads window information from the KWin API.

Now not sure yet which of these reads actually throws the error and whether or not this is a bismuth or an upstream issue.

jkcdarunday commented 1 year ago

Also adding that it does work well with X11 on Plasma 5.27.0. The issue only happens on Wayland.

CarlosEkisde commented 1 year ago

I managed to get it working in Xorg, I don't know how, I'm almost sure that the last time I tested on Xorg it showed the same faulty behaviour. On the other hand I've seen this commit landing on the kwin side https://github.com/KDE/kwin/commit/96fdc9d55a046fd0b106c467838b7f9ac5db6557 It seems very closely related to our problem. So maybe our pain is soon going to reach an end.

intentionally-left-nil commented 1 year ago

@CarlosEkisde: Built Plasma/kwin from source, but unfortunately it doesn't seem to fix the issue

Akergez commented 1 year ago

Can confirm it on 5.27, wayland, Fedora Kinoite. Works very unstable

Jeoshua commented 1 year ago

Honestly, I haven't noticed this plugin being any more or less stable under 5.27 (Kubuntu Beta PPA, X11 OR Wayland) than it has ever been. Yeah, there are some minor issues, but, again, nothing I didn't see in 5.26.

Vistaus commented 1 year ago

It works for me on 5.27.1 Wayland on Tumbleweed, however, it's a little buggy. Some windows don't get autotiled and already tiled windows don't resize back to bigger tiles.

dinotheextinct commented 1 year ago

It works for me on 5.27.1 Wayland on Tumbleweed, however, it's a little buggy. Some windows don't get autotiled and already tiled windows don't resize back to bigger tiles.

Its not just a little buggy, its completely random buggy. Opening 10 Terminals in a row gives different results. (some tiled some arent)

Unuseable for me in this state.

HelmicNewciv commented 1 year ago

Can report the same issue on Wayland. Normally it takes the form of a centered floating window, and I"ll have to close and re-open that app multiple times to get a version that'll tile, but I just managed to get a form where my browser window was using the 3 column layout - max vertical, taking up about 1/2 the screen centered. And I had just been using the 3 column layout moments prior. I kept closing and repoening until I could get a tiling verison again, and it kept being that same layout.

Sometimes windows that were working also seem to randomly stop responding ot Bismuth. Makes swwapping between windows very difficult. It also mucks up the UI's of many apps that don't expect to be that small, rendering them inoperable until I either fix their layout with my mouse (I don't have tilebars or borders on applications to save screen space when using many windows) or I close and re-open them.

Maybe KDE's new tiling features will make this not a problem soon.

Vistaus commented 1 year ago

@HelmicNewciv The only thing I miss from KDE's new tiling features is autotiling, which Bismuth does have. Someone has created a script for that now (https://store.kde.org/p/2003956), but it's supposedly very buggy and limited.

alxlg commented 1 year ago

Relevant fix for Krohnkite, can someone running Plasma 5.27 test the same change with Bismuth maybe?

https://github.com/esjeon/krohnkite/issues/213#issuecomment-1455151427

Thaodan commented 1 year ago

Relevant fix for Krohnkite, can someone running Plasma 5.27 test the same change with Bismuth maybe?

esjeon/krohnkite#213 (comment)

Maybe try to apply the change here: https://github.com/Bismuth-Forge/bismuth/blob/18cba1c8d3914afb97e311a7cc532769330ed89d/src/tile.ts#L84

alxlg commented 1 year ago

@Thaodan thanks, did you or anyone else have the chance to try it? I have not Plasma 5.27 to test it.

Thaodan commented 1 year ago

Alex L @.***> writes:

@Thaodan thanks, did you or anyone else have the chance to try it? I have not Plasma 5.27 to test it.

My comment was wrong I think, Bismuth isn't using the property anymore.

jkcdarunday commented 1 year ago

I think I may have found the cause of the undefined issue in my earlier comment and managed to fix it. I created PR #490 which fixes a lot of issues on Wayland for me.

So far, bismuth is working great with the changes in the PR above but I have yet to use it for a day.

dobladez commented 1 year ago

I confirm @jkcdarunday 's PR #490 solves the issue for me. Thanks!

endeavour commented 12 months ago

Fixes it for me too, much appreciated!

endeavour commented 12 months ago

I noticed this also fixes an issue in KDE Dolphin where if you start typing into the location textbox the dropdown appears in wrong place on the screen. :)

Edit: Sometimes anyway... seems to be some weird edge cases