Bug 462644

Summary: The name and window class of certain apps are not detected when creating a window rule
Product: [Plasma] kwin Reporter: Patrick Silva <bugseforuns>
Component: rulesAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: isma.af, nate, nicolas.fella
Priority: NOR    
Version First Reported In: 5.26.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.27
Sentry Crash Report:
Attachments: screenshot

Description Patrick Silva 2022-12-04 18:31:12 UTC
Created attachment 154310 [details]
screenshot

STEPS TO REPRODUCE
1. install MakeMKV from flathub
https://flathub.org/apps/details/com.makemkv.MakeMKV
2. open MakeMKV
3. right-click on the window decoration of MakeMKV, hover over 'More actions' and choose 'Configure special application settings...' 

OBSERVED RESULT
'Description' field says 'Application settings for' (the name of the app is missing) and 'Window class (application)' field is empty. Please see the attached screenshot.

EXPECTED RESULT
The name and window class of all apps should be detected

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Can also reproduce with Subtitle Edit from AUR 
https://aur.archlinux.org/packages/subtitleedit
Comment 1 Nicolas Fella 2022-12-04 21:52:51 UTC
MakeMKV doesn't set the WM_CLASS X11 property, so we can't do much there
Comment 2 Bug Janitor Service 2022-12-05 22:39:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3274
Comment 3 Ismael Asensio 2022-12-10 22:39:28 UTC
Git commit e8545fdb37a490cb702703865100ec9f1a12b0e9 by Ismael Asensio.
Committed on 10/12/2022 at 22:24.
Pushed by iasensio into branch 'master'.

kcms/rules: Notify when a window does not provide a class

Some applications do not provide a window class according to
the spec (WM_CLASS on X11, appId on Wayland), so KWin cannot
"detect" this property.

In those cases, notify the user that this is a bug within the
application (so it is not confused for a KWin misbehavior)
and also prevent setting a wrong description.
FIXED-IN: 5.27

M  +6    -2    src/kcmkwin/kwinrules/kcmrules.cpp
M  +11   -0    src/kcmkwin/kwinrules/rulesmodel.cpp

https://invent.kde.org/plasma/kwin/commit/e8545fdb37a490cb702703865100ec9f1a12b0e9