Bug 428859 - OSDs are maximized when using Maximized window placement policy
Summary: OSDs are maximized when using Maximized window placement policy
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland
: 428147 428875 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-11-08 20:21 UTC by Nicolas Fella
Modified: 2021-11-23 21:50 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Screenshot (740.92 KB, image/png)
2020-11-08 20:21 UTC, Nicolas Fella
Details
plasmashell wl debug (126.80 KB, text/x-log)
2020-11-09 09:59 UTC, Bhushan Shah
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2020-11-08 20:21:19 UTC
SUMMARY

OSDs for volume and brightness are very large when using the Maximized window placement policy. See screenshot

KDE Plasma Version: master
KDE Frameworks Version: master
Qt Version: latest 5.15 branch 

Wayland, haven't tested on X11 yet
Comment 1 Nicolas Fella 2020-11-08 20:21:37 UTC
Created attachment 133156 [details]
Screenshot
Comment 2 Justin Zobel 2020-11-09 01:50:57 UTC
Tested on:
Neon Unstable x11 - Not Affected
Neon User Edition Wayland - Not Affected
Comment 3 Bhushan Shah 2020-11-09 02:10:17 UTC
Mind you this bug happens on second invocation of the OSD and not the initial one.

I can confirm this bug.
Comment 4 Justin Zobel 2020-11-09 02:30:03 UTC
Thanks Bhushan, after second test can confirm.

Affects wayland only.
Comment 5 Vlad Zahorodnii 2020-11-09 09:46:38 UTC
Do the OSDs have correct window type? Would it be possible to have some WAYLAN_DEBUG output?
Comment 6 Bhushan Shah 2020-11-09 09:59:20 UTC
Created attachment 133163 [details]
plasmashell wl debug

WAYLAND_DEBUG of plasma-shell,

I show OSD, it is displayed correctly, it auto hides, and then is shown again which is not showed correctly.
Comment 7 Vlad Zahorodnii 2020-11-09 11:16:41 UTC
```
[2460820.694]  -> wl_compositor@4.create_surface(new id wl_surface@119)
[2460820.870]  -> xdg_wm_base@37.get_xdg_surface(new id xdg_surface@112, wl_surface@119)
[2460820.981]  -> xdg_surface@112.get_toplevel(new id xdg_toplevel@109)
[2460821.067]  -> xdg_toplevel@109.set_title("Plasma")
[2460821.132]  -> xdg_toplevel@109.set_app_id("org.kde.plasmashell")
[2460821.195]  -> wl_surface@119.set_buffer_scale(2)
[2460821.267]  -> wl_surface@119.set_buffer_transform(0)
[2460821.319]  -> wl_surface@119.commit()
[2460821.511]  -> xdg_surface@112.set_window_geometry(0, 0, 282, 44)
[2460827.167] xdg_toplevel@109.configure(360, 666, array)
[2460827.423] xdg_surface@112.configure(165)
...
[2460850.322]  -> org_kde_plasma_surface@115.set_role(3)
```

plasma sets the surface role too late
Comment 8 David Edmundson 2020-11-09 11:49:28 UTC
>plasma sets the surface role too late

Yeah, we only set it on expose event as we need a wl_surface to attach to.

wl_surface in QWaylandWindow is a bit inconsistent.

It exists when a platform window is created
It is removed when a window is hidden
It then only comes back when a window is shown again.

So as a hook we often use expose to cover that third case, but unfortunately it is after mapping
Comment 9 David Edmundson 2020-11-09 11:57:39 UTC
As a slightly horrible lazy hack, you can call destroy and create on QWindow after we hide

This will give you a surface, so we can set the role earlier
Comment 10 Nate Graham 2020-11-09 19:24:35 UTC
*** Bug 428875 has been marked as a duplicate of this bug. ***
Comment 11 Nate Graham 2020-11-09 19:25:04 UTC
Apparently this happens on X11 too. See Bug 428875.
Comment 12 Nate Graham 2021-04-27 15:32:08 UTC
*** Bug 428147 has been marked as a duplicate of this bug. ***
Comment 13 Toadfield 2021-06-13 21:47:56 UTC
This also happens when I edit the task bar,I assume that this is the same problem.
I also use custom window behavior.
Comment 14 Bug Janitor Service 2021-11-05 08:54:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1608
Comment 15 Bug Janitor Service 2021-11-08 08:53:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1181
Comment 16 Marco Martin 2021-11-08 16:12:42 UTC
Git commit 2ba1b0b642d540f74f0e21e7aaa272644ea4eda5 by Marco Martin.
Committed on 08/11/2021 at 16:12.
Pushed by mart into branch 'master'.

make the OSD an actual wayland OSD

when the OnScreenDisplay type is set, set it on the plasma shell surface
so KWin can actually treat it as such

M  +7    -0    src/plasmaquick/dialog.cpp

https://invent.kde.org/frameworks/plasma-framework/commit/2ba1b0b642d540f74f0e21e7aaa272644ea4eda5