Bug 483503 - Window rules: Force app to specific screen don't work with Wayland
Summary: Window rules: Force app to specific screen don't work with Wayland
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (other bugs)
Version First Reported In: 6.0.1
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: wayland-only
Depends on:
Blocks:
 
Reported: 2024-03-14 01:38 UTC by wmf
Modified: 2025-10-22 02:50 UTC (History)
9 users (show)

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


Attachments
WindowRuleGamescope (67.15 KB, image/png)
2024-06-26 12:22 UTC, Deckweiss75
Details

Note You need to log in before you can comment on or make changes to this bug.
Description wmf 2024-03-14 01:38:44 UTC
SUMMARY
***
System with two screens (0, 1). Firefox should be started always on the bigger screen (1). Works with X11, but not with Wayland.
***

STEPS TO REPRODUCE
1. Window Class (application): Exact Match: firefox firefox (detected by "Detect Window Properties")
2. Screen: Force: 1
3. Apply
4. Double click Firefox icon

OBSERVED RESULT
Firefox starts on Screen 0.

EXPECTED RESULT
Firefox starts on Screen 1.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 20240311
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
When doing this with X11, an other Window class (application) name is detected by "Detect Window Properties":
1. Window Class (application): Exact Match: Navigator firefox
This works correct with X11, but also not with Wayland.
Comment 1 daniel 2024-03-18 06:59:12 UTC
I have the same issue with Dolphin, konsole, system settings... pretty much everything  starts on the wrong screen no matter what settings I change on Wayland session.
Comment 2 kde 2024-03-18 17:34:47 UTC
For me it also does not work with X11.
Comment 3 jidec 2024-05-08 21:44:54 UTC
Same for me on Fedora 40 with Wayland: on single screen mode or dual screen mode, windows are not placed following the rules.
Comment 4 Deckweiss75 2024-06-26 12:20:44 UTC
Same for me on archlinux.

Here is the kscreen-doctor output: https://pastebin.com/3han58A9

As you can see there I have 2 displays. DP-1 is the "primary monitor", DP-2 is the "secondary monitor" a vertical 4k screen.

My issue: I have steam opened on the secondary. I start a game with gamescope. It starts on the secondary monitor, because thats where the mouse is. I want all games to start on the primary monitor of course. So I created a window rule (see screenshot) and it changed nothing about the behaviour.

No matter what I put into the screen field - when I export the rule it says "screenrule=2" and doesn't seem to contain the display number. https://pastebin.com/EvfucwX3

When the window is already open and I change the window rule and click apply, the window moves to the correct monitor. But when the game is started anew, it is always on the wrong one, because it seems to strictly follow the mouse.
Comment 5 Deckweiss75 2024-06-26 12:22:03 UTC
Created attachment 171009 [details]
WindowRuleGamescope
Comment 6 Deckweiss75 2024-06-26 12:23:30 UTC
The same window rule seemingly works for me on x11. Or maybe x11 has some other mechanism which makes the game window spawn on the primary screen.
Comment 7 Deckweiss75 2024-11-25 13:41:26 UTC
Any news? I still have the same issue.
Comment 8 aTosser 2024-12-12 20:54:40 UTC
I have been experiencing this issue for months. I have not been able to track it down. I do have some observations. Sometimes it happens after the screen turns off. When it comes back it's almost like it gets reconnected and becomes treated like a new screen and re-enumerated. This is a wild guess with little more than my usage to back it. 

The primary issue is there and I am changing status to confirmed.
Comment 9 Daniele Scasciafratte 2025-01-29 08:58:11 UTC
I can confirm with the latest version 24.12 doesn't work with wayland.
Also the Prorperty window detection doesn't share what is the Display number where the window is.