Bug 417856 - Panel background unhidden before Firefox CSD window visually touches
Summary: Panel background unhidden before Firefox CSD window visually touches
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Plasma
Component: containment (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-19 01:49 UTC by prettyvanilla
Modified: 2020-03-06 19:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Firefox with CSDs close to the panel (30.09 KB, image/png)
2020-02-19 01:49 UTC, prettyvanilla
Details
Firefox without CSDs in same position close to the panel (26.56 KB, image/png)
2020-02-19 01:50 UTC, prettyvanilla
Details

Note You need to log in before you can comment on or make changes to this bug.
Description prettyvanilla 2020-02-19 01:49:30 UTC
Created attachment 126152 [details]
Firefox with CSDs close to the panel

SUMMARY

With "Hide background when not needed" enabled on my latte panels the backgrounds stay hidden as expected when I have a Firefox window with normal KWin decorations until it actually touches or Firefox is maximized. When using Firefox with CSDs Latte behaves as if there was an invisible larger border around Firefox' window and becomes opaque quite a bit before it visibly touches.
Maybe this has to do with the changes in Plasma 5.18 re better support for GTK client-side decorations with shadows and resize areas?

STEPS TO REPRODUCE
1. Set a panel to "Hide background when not needed" that is otherwise opaque.
2. Configure Firefox to not use a "Title Bar" in its "Customize" view, thereby making it a client-side decorated window.
3. Observe the latte panel becoming opaque before Firefox visibly touches or is maximized.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.18.0
KDE Frameworks Version: 5.67.0
Qt Version: 5.14.1
Comment 1 prettyvanilla 2020-02-19 01:50:00 UTC
Created attachment 126153 [details]
Firefox without CSDs in same position close to the panel
Comment 2 Michail Vourlakos 2020-02-19 06:43:46 UTC
I don't think this is Latte solvable for the simple reason that new CSD windows in Plasma 5.18 provide a larger geometry for their shadows, so Latte is considering them as touching.
Comment 3 Michail Vourlakos 2020-02-19 06:46:02 UTC
The CSDs shadows are now probably considered as window borders and are included in its geometry.
Comment 4 Vlad Zahorodnii 2020-02-20 08:27:15 UTC
(In reply to Michail Vourlakos from comment #3)
> The CSDs shadows are now probably considered as window borders and are
> included in its geometry.
Yes, unfortunately that's the case on X11. We counter for this by subtracting _GTK_FRAME_EXTENTS from the server-side geometry of the window. By doing it, we don't need any drastic changes in KWin, for example we don't have to adjust our window snapping code or window placement code. "Everything just works."
Comment 5 Vlad Zahorodnii 2020-02-20 08:29:02 UTC
Is this a KWin bug, though?
Comment 6 Nate Graham 2020-02-22 15:55:22 UTC
Yeah the problem is that for GTK CSD windows, the window bounds are larger than they appear, since technically the shadow and the transparent resize area are a part of the window.

Is there any way for Latte Dock to detect that a window is using client-side decorations rather than server-side decorations and adjust its logic accordingly? Or for KWin to provide separate "actual window size" and "window content area size" information so that apps like Latte can do their detection using the latter?
Comment 7 Kai Uwe Broulik 2020-02-24 08:40:52 UTC
> Is there any way for Latte Dock to detect that a window is using client-side decorations rather than server-side decorations and adjust its logic accordingly? 

It could read the Gtk Frame Extents through KWindowSystem, I believe?
Comment 8 Nate Graham 2020-02-24 14:55:16 UTC
Ah yeah, it probably could!
Comment 9 Michail Vourlakos 2020-02-24 15:46:00 UTC
(In reply to Nate Graham from comment #8)
> Ah yeah, it probably could!

How?
Comment 10 Nate Graham 2020-02-24 16:41:30 UTC
Probably a question for the KWin developers
Comment 11 Michail Vourlakos 2020-03-06 19:49:20 UTC
Git commit d3b5e2c4eb89cfc2a60457f35c5670af65ad19ae by Michail Vourlakos.
Committed on 06/03/2020 at 19:45.
Pushed by mvourlakos into branch 'master'.

remove gtk_frame_extents from window geometries

--under x11 environment remove the gtk_frame_extents that
are used for shadows under plasma environment

M  +21   -0    app/wm/xwindowinterface.cpp
M  +5    -0    app/wm/xwindowinterface.h

https://commits.kde.org/latte-dock/d3b5e2c4eb89cfc2a60457f35c5670af65ad19ae