Bug 485690

Summary: X11 and Wayland use different Window Class Names
Product: [Plasma] kwin Reporter: Dominik Kummer <admin>
Component: rulesAssignee: KWin default assignee <kwin-bugs-null>
Status: CLOSED INTENTIONAL    
Severity: normal CC: Deckweiss75, fanzhuyifan, isma.af, kde, kdedev, s_chriscollins
Priority: NOR    
Version First Reported In: 6.0.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Dominik Kummer 2024-04-17 18:48:03 UTC
Rules defined under X11 do not work under Wayland due to different Window Class Names.
Comment 1 David Edmundson 2024-05-14 21:04:15 UTC
Unfortunately we are sent different information. There's nothing magic we can do.
Comment 2 Dominik Kummer 2024-05-14 22:19:29 UTC
Hi David! arn't programmers a kind of magician?
Kwin then should iterate each rule at login time and re-fetch the information if needed depending
on wheter X11 or Wayland is used. So a separate field for Wayland could be required in the kwin rule config.

It would be fatal to leave the manual job up to the user.
Imagine someone using X11 on an notebook and Wayland on desktop,
but wants to share Window Rules between both devices.
Comment 3 Deckweiss75 2024-06-26 12:26:19 UTC
Maybe it could be stored in the file whether it applies for wayland or x11. Or store two different files.

Afaik other things already do that. For example display settings (orientation, position, scaling) are seperate on wayland and x11.
Comment 4 fanzhuyifan 2024-08-04 07:06:41 UTC
As noted, kwin is sent different information on x11 and wayland.
Comment 5 Dominik Kummer 2025-06-21 19:33:12 UTC
With the latest Wayland migration things got worse. My window rules are not functional at all. Thats a disaster for any user relying on them to work!

I guess it could be possible to deduce the full application class name automatically. For example on X11 its just "dolphin" and on Wayland it is "org.kde.dolphin".
Comment 6 Dominik Kummer 2025-06-21 20:20:02 UTC
It may be true that the fact that Wayland and X11 provide different Window Class Names is intentional by Wayland.

But it cannot be intententional that KWin Rules Component cannot handle legacy configuration and does not provide migration support. This is horrible UX! You leave the user suddenly with a non-functional window manager component (rules). Why is this intentional?