https://bugs.kde.org/show_bug.cgi?id=520494
Bug ID: 520494
Summary: Allow kwin to override the strict Z-order stacking for
transient/popup windows on Wayland
Classification: Plasma
Product: kwin
Version First unspecified
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: wayland-generic
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
In a Wayland session, windows marked as `transient_for` (such as dialogs,
utility windows, and `xdg_popup` surfaces) are hard-coded to stay above their
parent window. In KWin, even when using "Window Rules" to force the parent to
"Keep Above" or the child to "Keep Below," the transiency link enforced by the
`xdg_shell` protocol overrides the user's configuration. The parent window
remains stuck behind the child, even when the user explicitly attempts to focus
or raise the parent.
**The Problem**
While the Wayland protocol (specifically `xdg_popup`) defines children as being
relative to and on top of parents for functional consistency, this creates a
"User Experience Lock." Users who need to see content on the main window that
is obscured by a persistent popup or a non-modal dialog are physically unable
to do so without moving or closing the child window. This is a regression from
X11, where the window manager had the authority to reorder the stack regardless
of transiency hints.
**Missing Functionality**
There is currently no mechanism in the KWin Window Rules GUI to:
1. **Orphan a window:** Manually strip the `transient_for` hint from a window
so KWin treats it as a standard, independent top-level surface.
2. **Override Transiency Stacking:** A property that allows a "Normal" layer
parent to be raised above its "Dialog" layer child.
**Proposed Solution / Implementation Ideas**
**1. Add a "Break Transiency" Property to Window Rules**
Introduce a new property in **Window Rules > Appearance & Fixes** called
**"Ignore Parent/Transient Relationship"** (boolean).
* **Effect:** When enabled, KWin should ignore the `transient_for` bit
provided by the client. This would allow the window to be handled as a
completely independent entity in the stacking order, allowing it to go behind
the window that created it.
**2. Allow "Layer" Rules to Override Transiency**
Currently, if a parent and child are in the same layer, the child wins. KWin
should allow a rule where:
* If the **Parent** is forced to the **"Above"** layer.
* And the **Child** is forced to the **"Normal"** or **"Below"** layer.
* **Result:** KWin should prioritize the Layer Rule over the Protocol
Transiency, allowing the parent to cover the child.
**3. Support "Orphaning" via KWin API**
Ensure that the KWin Scripting API has a stable, documented method to set
`window.transientFor = null`. This provides a fallback for power users to
automate the "breaking" of these links for specific applications.
**Rationale**
User agency should ultimately supersede protocol "hints." While the `xdg_shell`
spec suggests children stay on top, the compositor (KWin) should act as the
final authority on behalf of the user. If a user explicitly creates a rule to
keep a window below its parent, the compositor should provide a mechanism to
fulfill that request, regardless of whether the application is running via
XWayland or native Wayland.
STEPS TO REPRODUCE
1. Open Firefox.
2. Install an extension that makes pop-up windows from tabs, like this:
https://github.com/emvaized/open-in-popup-window-extension
3. Make a popup window with some page.
4. Try to make it displayed below the main Firefox window.
OBSERVED RESULT
No way to do this, neither manually nor with custom KDE window settings.
EXPECTED RESULT
We have to have a way to make the pop-up windows be able to render below the
main window via some custom settings.
SOFTWARE/OS VERSIONS
Operating System: Kubuntu 26.04 LTS
KDE Plasma Version: 6.6.4
KDE Frameworks Version: 6.24.0
Qt Version: 6.10.2
Kernel Version: 7.0.0-15-generic (64-bit)
Graphics Platform: Wayland
--
You are receiving this mail because:
You are watching all bug changes.