SUMMARY Shortcut applied through Window Rules only works the first time the application is started. After closing and restarting the application, the shortcut no longer works. It only works again after system reboot. STEPS TO REPRODUCE 1. Assign shortcut for an application (e.g. Konsole) through Window Rules 2. Try shortcut 3. Exit application 4. Start application 5. Try shortcut OBSERVED RESULT Works first time. Doesn't work after application restart. EXPECTED RESULT Works always. SOFTWARE/OS VERSIONS Operating System: KDE neon Unstable Edition KDE Plasma Version: 5.90.90 KDE Frameworks Version: 5.247.0 Qt Version: 6.6.1 Kernel Version: 6.2.0-34-generic (64-bit) Graphics Platform: Wayland Processors: 8 × Intel® Core™ i7-7700HQ CPU @ 2.80GHz Memory: 23.3 GiB of RAM Graphics Processor: Mesa Intel® HD Graphics 630
I am unable to reproduce the issue. Please provide all the details about the window rule (type, shortcut, etc)
Created attachment 164912 [details] Window Rules for Konsole (In reply to Vlad Zahorodnii from comment #1) > I am unable to reproduce the issue. Please provide all the details about the > window rule (type, shortcut, etc) I hope you're trying this on Wayland. This is an issue on Wayland only. Also, I've the same issue on multiple machines, and multiple distros (Arch Linux and KDE Neon Unstable) and so I'm confident that this should be reproducible. I've attached a screenshot of the Window Rules I'm using for Konsole. This is my ~/.config/kwinrulesrc [$Version] update_info=kwinrules.upd:replace-placement-string-to-enum,kwinrules.upd:use-virtual-desktop-ids [1] Description=Application settings for Konsole above=true aboverule=3 desktops=\\0 desktopsrule=2 minimize=true minimizerule=3 placementrule=2 shortcut=Meta+Return shortcutrule=2 skippager=true skippagerrule=3 skipswitcher=true skipswitcherrule=3 skiptaskbar=true skiptaskbarrule=3 wmclass=konsole org.kde.konsole wmclasscomplete=true wmclassmatch=1 [General] count=1 rules=1
Works fine on my machine. Have you tried using other shortcut?
Okay, I've figured out the issue now! This happens when the Shortcut is set to "Force". It works when set to "Apply Initially". Can you reproduce the problem now? Why does setting it to "Force" create this issue? Is that intended behaviour?
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4926
Git commit b98607c6893633e0b5743132049e903ff59f533e by Vlad Zahorodnii. Committed on 15/01/2024 at 15:24. Pushed by vladz into branch 'master'. Fix cleanup of forced window shortcuts XdgToplevelWindow doesn't call finishWindowRules(). It creates a problem for Workspace::removeWindow() because it calls setShortcut() to release the window shortcut. While one way to fix the bug would be to add a finishWindowRules() call in XdgToplevelWindow, it would perhaps be not the best one because it would change the appearance of decoration when the window is closed. Instead, this change makes the workspace release the shortcut when the window is closed. It has a couple of advantages: the appearance of the decoration won't change, shortcut cleanup is better encapsulated. M +5 -0 src/useractions.cpp M +0 -4 src/workspace.cpp https://invent.kde.org/plasma/kwin/-/commit/b98607c6893633e0b5743132049e903ff59f533e
Git commit b62d212a5833a389b1aaa3a7ad4187e56e729e18 by Vlad Zahorodnii. Committed on 15/01/2024 at 15:41. Pushed by vladz into branch 'Plasma/6.0'. Fix cleanup of forced window shortcuts XdgToplevelWindow doesn't call finishWindowRules(). It creates a problem for Workspace::removeWindow() because it calls setShortcut() to release the window shortcut. While one way to fix the bug would be to add a finishWindowRules() call in XdgToplevelWindow, it would perhaps be not the best one because it would change the appearance of decoration when the window is closed. Instead, this change makes the workspace release the shortcut when the window is closed. It has a couple of advantages: the appearance of the decoration won't change, shortcut cleanup is better encapsulated. (cherry picked from commit b98607c6893633e0b5743132049e903ff59f533e) M +5 -0 src/useractions.cpp M +0 -4 src/workspace.cpp https://invent.kde.org/plasma/kwin/-/commit/b62d212a5833a389b1aaa3a7ad4187e56e729e18