Bug 461997 - xdg_positioner.set_constraint_adjustment(none) is ignored
Summary: xdg_positioner.set_constraint_adjustment(none) is ignored
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (other bugs)
Version First Reported In: 5.26.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-18 14:36 UTC by Mark Bolhuis
Modified: 2024-06-10 10:36 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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