Bug 461994

Summary: A xdg_popup does not follow it's parent surface unless set_reactive is called
Product: [Plasma] kwin Reporter: Mark Bolhuis <mark>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: 5.26.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.0
Sentry Crash Report:

Description Mark Bolhuis 2022-11-18 14:18:54 UTC
SUMMARY
An xdg_popup should always follow the parent surface regardless of the xdg_positioner.set_reactive request being called or not. The set_reactive request only concerns re-constraining the popup if the constraints change, which may happen by moving the window.

STEPS TO REPRODUCE
1. Create a xdg_toplevel and xdg_popup child
2. Do not call set_reactive on the associated xdg_positioner
3. Move the parent toplevel window

OBSERVED RESULT
The window moves and the popup doesn't.

EXPECTED RESULT
The popup should follow the parent.

SOFTWARE/OS VERSIONS
Linux: arch6.0.9-arh1-1
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Comment 1 Bug Janitor Service 2023-01-06 12:05:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3401
Comment 2 Kai Uwe Broulik 2023-08-21 11:24:08 UTC
Git commit 410ca44e6e23e7b709fb55592c6d11dcfc3a72d6 by Kai Uwe Broulik.
Committed on 21/08/2023 at 13:17.
Pushed by broulik into branch 'master'.

XdgPopupWindow: Reposition for non-reactive positioners

Ensures that e.g. context menus move about with their parents when they
get moved around.

However, as per spec don't re-constrain the window when its positioner
is non-reactive. This change calculates the offset from its parent window
once initially and places the window relative to that whenever the parent
moves.

Only when the positioner is reactive, will it recalculate the placement fully.

M  +34   -7    autotests/integration/xdgshellwindow_test.cpp
M  +23   -17   src/xdgshellwindow.cpp
M  +5    -2    src/xdgshellwindow.h

https://invent.kde.org/plasma/kwin/-/commit/410ca44e6e23e7b709fb55592c6d11dcfc3a72d6