Closed Bug 1924616 Opened 1 month ago Closed 29 days ago

[KDE] Tiling in KDE Plasma not detected (Client-Side Decorations)

Categories

(Core :: Widget: Gtk, enhancement, P3)

Firefox 131
enhancement

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: breakingspell, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

This follows https://bugzilla.mozilla.org/show_bug.cgi?id=1919115
The issue has been resolved in Wayland but still persists in X11, identical to the original report.


Easy indicator of the issue is presence of left tab spacer UI element (it disappears when properly tiled), or modifying the value of gtktiledwindow in the Browser Toolbox.

This may be difficult to fix unless the QT/Kwin tiled state can be read from X/Wayland hints, but once the tiled state can be determined, setting gtktiledwindow=true would theme the Browser Chrome correctly, thanks to the existing routine for GNOME.


In my tests, the forced 1px resize border is the cause of the bug and the tiled windows work much better without this handle.
The line at https://hg.mozilla.org/releases/mozilla-beta/rev/a18dbf2a4053#l2.33 is the core switch for this behavior, I disabled it in a local build and it seems to fix this issue exactly.

The resize handles are still drawn where expected due to the serverside Kwin compositor/custom tiler. When in a quick or custom tile, the resizers are still drawn as they should be on the open edge, not the edges shared with a screen.

The Firefox windows stay tiled unless manually untiled, and most importantly for usability: the top pixels can be used to select tabs.


Both of these tweaks improve usability immensely and seem to behave as they should, bringing Firefox behavior in KDE to alignment with GNOME.

Screenshots attached of both issues with the actual and expected behaviors.

Let me know if there are any additional details I should provide, or if users encounter similar or different behavior on KDE Plasma 5 and 6.

Attached image Testing-D223977-1a.gif

Attached gif shows intended behavior (left) and broken tiling on right (Client-size resizers cause unsnap).

Blocks: gtk-kde
Priority: -- → P3

Interesting, so in testing a separate issue in Wayland on my laptop, I found this exact issue still occurs in both X11 and Wayland. The top 1px of a snapped window does not allow for tab strip interaction and behaves erratically (resizer pops window and cursor flickers between states when held against the top 1px).

I'd like to draw specific notice to the routine at https://hg.mozilla.org/releases/mozilla-beta/rev/a18dbf2a4053#l2.33 and the notes preceding it.
Bypassing this return seems to resolve the issue in both X11 and Wayland and allows top-pixel interaction with the tab strip just like GNOME. This could be done more elegantly I'm sure, but for now that line seems to be doing more harm than good.

Emilio, hope you don't mind if I tag you for this one too. Really appreciate the help pinning these down.

Flags: needinfo?(emilio)
Summary: [KDE] Tiling in KDE Plasma not detected (X11 Client-Side Decorations) → [KDE] Tiling in KDE Plasma not detected (Client-Side Decorations)

What version of plasma/kwin are you using? I can't repro this in Wayland, works fine for me.

I'll look at x11 when I have some time.

Thanks for looking! I am using Plasma 6.2.1 on Arch Linux. I can definitely reproduce this in both X11 and Wayland in freshly created accounts (default panels and screen settings, repository Firefox package, no existing profiles).

This really does seem caused by the forced resizer Firefox draws in KDE. Just commenting out this line and testing will demonstrate the difference.

The initial cause of the upstream KDE bug report was a tiling enhancement in Kwin which affected all applications that draw client-side decorations.
Specifically, the "Interactive Move/Resize" code. I hope this context helps, I've been tracking this for a while on the KDE side.

I do think the fix is just to undo the old band-aid of BUG 1813554 just like it was undone for GNOME in BUG 1822764. It works for me in X11 and Wayland once patched in this manner.

I'm using the same version of Plasma also on Arch, and nightly detects tiling correctly (on Wayland) right?

I just tried X11, and it doesn't detect the tiling correctly. That is somewhat expected because it uses a GTK-specific extension:

  XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
                      GDK_WINDOW_XID (window),
                      gdk_x11_get_xatom_by_name_for_display (display, "_GTK_EDGE_CONSTRAINTS"),
                      0, G_MAXLONG, False, XA_CARDINAL, &type,
                      &format, &nitems,
                      &bytes_after, &data);

Plasma could implement _GTK_EDGE_CONSTRAINTS, but other than that there's no real way to fix this on our end afaict.

That said, it seems by the time we fixed bug 1813554, plasma allowed to resize tiled windows (bug 1813554 comment 5). But now those same STR don't work on apps like Konsole or so... agreed that maybe just removing that seems fine now.

Flags: needinfo?(emilio)
See Also: → 1919115, 1813554

This was implemented in bug 1813554 to allow resizing tiled windows at
the top of the window, but since then KWin has changed behavior and no
longer allows resizing tiled windows, so this is now unnecessary.

Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Confirmed the resizer adjustment works in X11 and Wayland on latest Plasma and Firefox, tested windowed, tiled, maximized, and picture-in-picture states to make sure the Kwin resizers are properly drawn. Thanks a ton!

For the _GTK_EDGE_CONSTRAINTS WM hint, I will double back to the KDE/Kwin team with this finding to see if it can be implemented on that side, or if it's handled in another way. X11 is fairly end-of-support but this hint could fix behavior in other GTK applications as well.

Status: ASSIGNED → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: