Bug 462115

Summary: xdg_popup sent excessive configure events on parent window move
Product: [Plasma] kwin Reporter: Mark Bolhuis <mark>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: kde, nate
Priority: NOR    
Version First Reported In: 5.26.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Mark Bolhuis 2022-11-22 07:45:22 UTC
SUMMARY
When a xdg_popup is created with set_reactive kwin sends a configure sequence every time the parent window moves, even if the movement of the window doesn't result in needing to re-constrain the popup.

STEPS TO REPRODUCE
1. Create a xdg_popup with set_reactive.
2. Move the parent window.

OBSERVED RESULT
The popup is sent a configure sequence continuously as the parent window moves even if it does not need to be re-constrained.

EXPECTED RESULT
The popup should only receive a configure sequence if the popup needs to be re-constrained. 

SOFTWARE/OS VERSIONS
Linux: 6.0.9-arch1-1
KDE Plasma Version: 5.26.3
KDE Frameworks Version:  5.100.0
Qt Version: 5.15.7

RELATED BUGS
https://bugs.kde.org/show_bug.cgi?id=461997
https://bugs.kde.org/show_bug.cgi?id=461994
Comment 1 Vlad Zahorodnii 2022-11-22 09:41:48 UTC
> The popup should only receive a configure sequence if the popup needs to be re-constrained. 

Does the spec say so?
Comment 2 Mark Bolhuis 2022-11-22 11:19:31 UTC
(In reply to Vlad Zahorodnii from comment #1)
> > The popup should only receive a configure sequence if the popup needs to be re-constrained. 
> 
> Does the spec say so?

Relevant parts of the spec are:

xdg_popup.configure: "For version 2 or older, the configure event for an xdg_popup is only ever sent once for the initial configuration. Starting with version 3, it may be sent again if the popup is setup with an xdg_positioner with set_reactive requested, or in response to xdg_popup.reposition requests."

xdg_positioner.set_reactive: "If the conditions changed and the popup was reconstrained, an xdg_popup.configure event is sent with updated geometry, followed by an xdg_surface.configure event."

xdg_popup.reposition: "The popup will be placed given the details in the passed xdg_positioner object, and a xdg_popup.repositioned followed by xdg_popup.configure and xdg_surface.configure will be emitted in response."


Technically speaking the spec doesn't explicitly forbid sending the configure event arbitrarily, only that it must if the popup needs re-constraining.
However, I argue that sending arbitrary events like this is not the point, especially since its in response to window position, something Wayland windows aren't aware of. Also the parameters are identical, so the client can't do anything meaningful with it.