Bug 415317 - click on an entry of the context menu of systray icons has no effect on Wayland
Summary: click on an entry of the context menu of systray icons has no effect on Wayland
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: System Tray (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL: https://phabricator.kde.org/D26233
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2019-12-18 14:29 UTC by Patrick Silva
Modified: 2020-01-10 19:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.18.0
kde: Wayland+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2019-12-18 14:29:46 UTC
STEPS TO REPRODUCE
1. start Wayland session
2. right click on any systray icon
3. click on any entry of the context menu

OBSERVED RESULT
nothing happens. And no effect appears when we hover over any entry
of the conmtext menu.

EXPECTED RESULT
click has effect

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.17.80
KDE Frameworks Version: 5.66.0
Qt Version: 5.13.2
Comment 1 Patrick Silva 2019-12-23 10:27:04 UTC
mouse input also does not work with context menus of kickoff and kicker.
Comment 2 Patrick Silva 2019-12-23 11:20:17 UTC
menus of Spectacle buttons are also affected.
open Spectacle on Wayland
click on any button with down arrow on bottom
the menu just closes itself when an entry is clicked. Also no hovering affect.
Comment 3 David Edmundson 2019-12-23 18:04:32 UTC
Things I have learned so far for the system tray popup case:

 - Qt menu correctly sends a grab on the popup
 - kwin correctly receives the grab on the popup in PopupInputFilter
 - Qt does not get a pointer_enter event to the popup, only the panel underneath
 - Qt then sends input to the window it has been told has focus
Comment 4 David Edmundson 2019-12-23 18:50:08 UTC
Git bisect shows it has being introduced during the big CSD patchset.


Can't quite work out which one as they're all tied together and some commits don't work.

# good: [c22546868d75e94cd1a31b89daddd002555f1919] [effects] fix mouse wheel detection
git bisect good c22546868d75e94cd1a31b89daddd002555f1919
# good: [f62086f9d3518c0c7e0a3cf34981e0aa57b543d1] [effects] Remove unneeded link to KService
git bisect good f62086f9d3518c0c7e0a3cf34981e0aa57b543d1
# bad: [754b72d155820a6c8a9ba94b2c0960da1b2f86ce] [x11] Name client pixmap instead of frame pixmap
git bisect bad 754b72d155820a6c8a9ba94b2c0960da1b2f86ce
# bad: [84d75cb5674577098d584c7f3634ea2a81d8b9f2] [x11] Add support for _GTK_FRAME_EXTENTS
git bisect bad 84d75cb5674577098d584c7f3634ea2a81d8b9f2
# good: [6bfa931f2b1d9787e75c4be4e44611d51ba835c3] Associate output transforms and orientations
git bisect good 6bfa931f2b1d9787e75c4be4e44611d51ba835c3
Comment 5 David Edmundson 2019-12-25 22:51:22 UTC
Found it!

>void XdgShellClient::handleWindowGeometryChanged(const QRect &windowGeometry)
{
    qDebug() << this << "handleWindowGeometryChanged" << windowGeometry;
    const QRect boundingRect = subSurfaceTreeRect(surface());
    m_windowGeometry = windowGeometry      & boundingRect;  <--- HERE!!!
    m_hasWindowGeometry = true;


Bounding rect is null as we don't have a surface at the time of doing initial placement. We just have a pending initial size.

This gets us in a messed up state, where we think the window is 1x1 with just a really massive giant animating frame.

Also the cause of the weird "ghost" notifications that you can't interact with.
Comment 6 David Edmundson 2019-12-26 23:03:27 UTC
See D26233
Comment 7 David Edmundson 2020-01-06 15:17:08 UTC
Git commit 89024e2bcc1b2c2bae6bd75e85792cc67de9337c by David Edmundson.
Committed on 06/01/2020 at 15:10.
Pushed by davidedmundson into branch 'master'.

Clamp XdgShellClient::clientSize to surface size, not m_windowGeometry

Summary:
It's perfectly legitimate to call setWindowSize before a buffer is
attached. This seems to have happen with plasma surfaces that commit
when attaching a shadow, but technically could happen anywhere.

By clamping to the applied surface here, we get the wrong window size
cached and not re-evaluated when a surface is eventually applied. This
leaves us thinking the windowsize is empty but with a massive margin
which actually holds the content.

We want all internal usages of xdgshellclient to use the window geometry
set. Only the wider kwin part needs to care about clamping it to the
surface.

This fixes popup placement in the plasma panel

As well as ghost notification popups with no background contrast that
you can't interact with.

Test Plan: Ran kwin

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26233

M  +22   -22   xdgshellclient.cpp

https://commits.kde.org/kwin/89024e2bcc1b2c2bae6bd75e85792cc67de9337c