Bug 461997

Summary: xdg_positioner.set_constraint_adjustment(none) is ignored
Product: [Plasma] kwin Reporter: Mark Bolhuis <mark>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal 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-18 14:36:13 UTC
SUMMARY
A xdg_popup with set_reactive called, and with a constraint_adjustment of none is still adjusted by slide_x and slide_y rules.

STEPS TO REPRODUCE
1. Create a xdg_positioner with a constraint adjustment of none and is reactive.
2. Create a xdg_toplevel and xdg_popup child with that positioner.
3. Move the window such that the popup will be constrained.

OBSERVED RESULT
The popup slides in both the x and y axis as if slide_x and slide_y were passed to set_constraint_adjustment

EXPECTED RESULT
The popup should stay fixed relative to the anchor point on the parent.

SOFTWARE/OS VERSIONS
Linux: arch6.0.8-arch1-1
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Comment 1 David Edmundson 2022-11-18 14:46:35 UTC
What's the user-facing bug we're trying to fix? 
----

Relevant code is is placement.cpp: placeTransient


    // Potentially a client could set no constraint adjustments
    // and we'll be offscreen.

    // The spec implies we should place window the offscreen. However,
    // practically Qt doesn't set any constraint adjustments yet so we can't.
    // Also kwin generally doesn't let clients do what they want
    if (!screen.contains(c->moveResizeGeometry().toAlignedRect())) {
        c->keepInArea(screen);
    }
Comment 2 Mark Bolhuis 2022-11-18 14:54:04 UTC
(In reply to David Edmundson from comment #1)
> What's the user-facing bug we're trying to fix? 

That if the popup is created with a constraint_adjustment of none that the popup isn't constrained, as per the spec.
Based on that code snippet I assume then don't call c->keepInArea(screen);
Comment 3 Vlad Zahorodnii 2024-06-10 10:36:59 UTC
it should be fixed in 6.0