Bug 464190 - [Wayland] Window rules don't work with Element Desktop
Summary: [Wayland] Window rules don't work with Element Desktop
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: rules (show other bugs)
Version: 5.26.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-12 13:45 UTC by Celeste Liu
Modified: 2023-01-18 21:31 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27
Sentry Crash Report:


Attachments
property of element (18.49 KB, image/png)
2023-01-12 13:45 UTC, Celeste Liu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Celeste Liu 2023-01-12 13:45:11 UTC
Created attachment 155234 [details]
property of element

SUMMARY

When I apply window rules for Element they don't work.
Rule is
[element]
Description=element
desktops=89fc92f3-0710-4a38-9b3f-4ea322967037
desktopsrule=2
wmclass=electron element
wmclasscomplete=true
wmclassmatch=1

STEPS TO REPRODUCE
1. Run wayland session
2. Setup window rules (example above)
2. Launch Element as native wayland app (https://wiki.archlinux.org/title/Wayland#Electron), use 1.11.16 if you use Arch(there is a bug leading crash)
OBSERVED RESULT

Rules are not being applied. Window is on wrong virtual desktop.

EXPECTED RESULT

Rules apply according to their definition.


SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.8
Graphics Platform: Wayland

ADDITIONAL INFORMATION

property of element is in attachment
Comment 1 Nate Graham 2023-01-12 20:20:20 UTC
Same issue as Bug 453374; see the explanation there.

*** This bug has been marked as a duplicate of bug 453374 ***
Comment 2 Celeste Liu 2023-01-13 00:24:51 UTC
(In reply to Nate Graham from comment #1)
> Same issue as Bug 453374; see the explanation there.
> 
> *** This bug has been marked as a duplicate of bug 453374 ***

Not same, please see attachment above, its app id is Element not electron.
Comment 3 Vlad Zahorodnii 2023-01-16 11:14:35 UTC
"wmclass=electron element" but the app id is "Element", one is lower case, the other is upper case.
Comment 4 Celeste Liu 2023-01-16 11:22:14 UTC
(In reply to Vlad Zahorodnii from comment #3)
> "wmclass=electron element" but the app id is "Element", one is lower case,
> the other is upper case.

First, after I right click menu of titlebar of element, I got default value LOWER case 'electron element'. It may be a problem.

Secondly, although I change it to upper case 'Element' and use substring match, it still not work. New rule is 
[element]
Description=element
desktops=89fc92f3-0710-4a38-9b3f-4ea322967037
desktopsrule=2
wmclass=Element
wmclasscomplete=true
wmclassmatch=2
Comment 5 Bug Janitor Service 2023-01-16 11:24:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3441
Comment 6 Vlad Zahorodnii 2023-01-16 11:26:55 UTC
(In reply to Celeste Liu from comment #4)
> (In reply to Vlad Zahorodnii from comment #3)
> > "wmclass=electron element" but the app id is "Element", one is lower case,
> > the other is upper case.
> 
> First, after I right click menu of titlebar of element, I got default value
> LOWER case 'electron element'. It may be a problem.
> 
> Secondly, although I change it to upper case 'Element' and use substring
> match, it still not work. New rule is 
> [element]
> Description=element
> desktops=89fc92f3-0710-4a38-9b3f-4ea322967037
> desktopsrule=2
> wmclass=Element
> wmclasscomplete=true
> wmclassmatch=2

"wmclass=Element" is wrong, it should be "wmclass=electron Element"
Comment 7 Vlad Zahorodnii 2023-01-16 11:27:57 UTC
Ah, nvm, I did notice "substring"
Comment 8 Vlad Zahorodnii 2023-01-16 11:28:07 UTC
didn't*
Comment 9 Vlad Zahorodnii 2023-01-16 17:59:03 UTC
Git commit 5963790b21ae9bfd10e425a3d0cf3f14fad14251 by Vlad Zahorodnii.
Committed on 16/01/2023 at 16:52.
Pushed by vladz into branch 'master'.

kcms/rules: Use window class and role with original casing

The window rules kcm uses lower-case window class and role, but kwin can
use window class and role with other casing, which will break the ExactMatch
match rule.

M  +6    -6    src/kcms/rules/kcmrules.cpp
M  +7    -7    src/rules.cpp

https://invent.kde.org/plasma/kwin/commit/5963790b21ae9bfd10e425a3d0cf3f14fad14251
Comment 10 Vlad Zahorodnii 2023-01-16 18:10:05 UTC
> Secondly, although I change it to upper case 'Element' and use substring match, it still not work
This should be fixed too