SUMMARY With Plasma 6.1 from git master, I noticed that the bindings I have set up for the additional buttons on my mouse no longer work, they just end up doing the default action bound to them. In my case the buttons are recognized by libinput as `BTN_EXTRA (276)` and `BTN_SIDE (275)`. If I revert the part of commit bf1ce854748bfd2433c336a9ee972883cb8617ab (Make it possible to build KWin without libxcb) that applies to the buttonrebinds plugin then the bindings work again, and reverting KWin to the commit before that also works. In the system logs, these messages appeared when I pressed the mouse buttons (two of these messages appear for every button press): > kwin_wayland[42047]: kwin_buttonrebinds: Could not convert QKeySequence("Meta+G") syms: QList(285212743) to keycode > kwin_wayland[42047]: kwin_buttonrebinds: Could not convert QKeySequence("Meta+G") syms: QList(285212743) to keycode > kwin_wayland[42047]: kwin_buttonrebinds: Could not convert QKeySequence("Alt+F1") syms: QList(150994992) to keycode > kwin_wayland[42047]: kwin_buttonrebinds: Could not convert QKeySequence("Alt+F1") syms: QList(150994992) to keycode STEPS TO REPRODUCE 1. Have a mouse with extra buttons that can be configured via the "Re-bind Additional Mouse Buttons..." page in the Mouse KCM (mine is just a random "gaming" mouse I picked up in a nearby store, with two side buttons) 2. Set up a binding for one of those mouse buttons (I used Meta+G and Alt+F1 for the desktop grid and app launcher) 3. Press the mouse button with the binding OBSERVED RESULT The button acts as if no binding was set and just performs the default action (for me the buttons act like forward and back buttons of some sort out of the box). EXPECTED RESULT The keyboard shortcut bound to the button should be triggered. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.0.80 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Kernel Version: 6.7.8-arch1-1 (64-bit) Graphics Platform: Wayland
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5409
Two issues here: 1. We need to remove the modifiers. This is handled by the the MR above. 2. QXkbCommon::toKeysym sometimes only returns one key sym even when there are multiple matching key syms. (https://github.com/qt/qtbase/blob/dev/src/gui/platform/unix/qxkbcommon.cpp#L455) E.g., the Qt::Key_Delete maps to both XKB_KEY_Delete and XKB_KEY_Clear, but QXkbCommon::toKeysym only returns XKB_KEY_Clear... I will try to upstream a patch for that
See https://bugreports.qt.io/browse/QTBUG-123135 and https://codereview.qt-project.org/c/qt/qtbase/+/546610
Git commit 6c4551ff46b1b2ed26dd3d3ab5601da8dd2cb19d by Yifan Zhu. Committed on 14/03/2024 at 21:37. Pushed by fanzhuyifan into branch 'master'. plugins/buttonrebinds: remove modifiers before keysym conversion QXkbCommon::toKeysym can't handle modifiers in key. M +1 -1 src/plugins/buttonrebinds/buttonrebindsfilter.cpp https://invent.kde.org/plasma/kwin/-/commit/6c4551ff46b1b2ed26dd3d3ab5601da8dd2cb19d
https://github.com/KDE/kwin/commit/bf1ce854748bfd2433c336a9ee972883cb8617ab
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5628