Bug 502561

Summary: Using a keyboard shortcut set in Window Rules does not do anything
Product: [Plasma] kwin Reporter: Piotr Dobrogost <bugs.kde.org>
Component: rulesAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: isma.af, kdedev
Priority: NOR    
Version First Reported In: 6.3.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: window rules
window's properties

Description Piotr Dobrogost 2025-04-08 12:59:29 UTC
Created attachment 180090 [details]
window rules

I have set a window rule to apply keyboard shortcut to the specific window as shown in the attached screenshot but the shortcut does not work.
I can see that the window is being matched by setting opacity in the same rule so the
problem is with applying the shortcut not matching a window.
I have similar rules which apply keyboard shortcuts for other windows and they work properly.
I tried different keyboard shortcuts and nothing worked.

One thing specific to this case is that it's the second window of one application (JetBrains' PyCharm IDE).

```
$ kinfo
Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.13.9-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7600 6-Core Processor
Memory: 14.8 GiB of RAM
Graphics Processor: AMD Radeon Graphics
```
Comment 1 Piotr Dobrogost 2025-04-08 12:59:55 UTC
Created attachment 180091 [details]
window's properties
Comment 2 TraceyC 2025-04-09 16:50:24 UTC
I'm able to confirm this behavior on git-master by setting the same keyboard shortcut to the properties of the KWrite window, and using similar rules to the ones you have.
When I use the shortcut, nothing happens

I'm also able to reproduce the problem with PyCharm (community edition) on Plasma 6.3.4
Comment 3 Piotr Dobrogost 2025-04-09 18:53:20 UTC
Thanks TraceyC very much for taking a look at this!

> I'm able to confirm this behavior on git-master by setting the same keyboard shortcut to the properties of the KWrite window, and using similar rules to the ones you have.

Could you please describe in more details how did you manage to reproduce this with KWrite? I'm asking because I do not see an easy way of doing this.
With PyCharm, when one opens debug window it has "Debug" word present in the window's title and this allows to target this window only (as opposed to the main PyCharm window opened earlier which does not have this word in its title).
However with KWrite, when one opens the second window its title is the same as the title of the first one ("Welcome – KWrite") which seems to not allow to target each window with separate window rule.
Comment 4 TraceyC 2025-04-10 15:52:39 UTC
With KWrite, I added a shortcut and kept all the other settings as default
Window class - Exact match
Match whole window class - Yes
Window types - normal window

With only one KWrite window open, I expected the shortcut to toggle it. In any case, being able to reproduce with PyCharm matches your situation
Comment 5 Piotr Dobrogost 2025-06-03 13:46:17 UTC
Could someone please take a look at this?