libqt5-qtbase/Fix-Meta-shortcuts-on-XCB.patch
Dominique Leuenberger 7169baff88 Accepting request 286573 from KDE:Qt5
- Added patches from upstream:
  Fix-Meta-shortcuts-on-XCB.patch (qtbug#43572),
  Fix-detection-of-GCC5.patch,
  Fix-physical-DPI-and-size-for-rotated-screens-on-X11.patch
  (qtbug#43688), Fix-typo-in-Qt5CoreMacroscmake.patch,
  Make-sure-theres-a-scene-before-using-it.patch (qtbug#44509),
  Multi-screen-DPI-support-for-X11.patch (qtbug#43713),
  QSystemTrayIcon-handle-submenus-correctly.patch,
  Update-mouse-buttons-from-MotionNotify-events.patch
  (qtbug#32609, qtbug#35065, qtbug#43776, qtbug#44166, qtbug#44231),
  X11-devicePixelRatio-screen-mapping-fix.patch (qtbug#43713) and
  xcb-Dont-return-0-from-QXcbKeyboard-possibleKeys.patch
  (qtcreatorbug#9589)

OBS-URL: https://build.opensuse.org/request/show/286573
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=37
2015-02-20 11:43:00 +00:00

54 lines
2.3 KiB
Diff

From: Kåre Särs <kare.sars@iki.fi>
Date: Thu, 22 Jan 2015 20:40:37 +0000
Subject: Fix Meta+... shortcuts on XCB
X-Git-Url: http://quickgit.kde.org/?p=qt%2Fqtbase.git&a=commitdiff&h=0d990b9ca117514fe83f53b39f25d6272304f2fb
---
Fix Meta+... shortcuts on XCB
If the window contains a widget that accepts text input, a Meta+...
shortcut will be interpreted as if no modifier was pressed. This fix
enables the usage of Meta+... shortcuts for the XCB platform plugin.
Change-Id: I80034b7e6bbbf18471c86fc77320d5038f5740be
Task-number: QTBUG-43572
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
---
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -933,7 +933,7 @@
QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
{
// turn off the modifier bits which doesn't participate in shortcuts
- Qt::KeyboardModifiers notNeeded = Qt::MetaModifier | Qt::KeypadModifier | Qt::GroupSwitchModifier;
+ Qt::KeyboardModifiers notNeeded = Qt::KeypadModifier | Qt::GroupSwitchModifier;
Qt::KeyboardModifiers modifiers = event->modifiers() &= ~notNeeded;
// create a fresh kb state and test against the relevant modifier combinations
struct xkb_state *kb_state = xkb_state_new(xkb_keymap);
@@ -963,10 +963,12 @@
xkb_mod_index_t shiftMod = xkb_keymap_mod_get_index(xkb_keymap, "Shift");
xkb_mod_index_t altMod = xkb_keymap_mod_get_index(xkb_keymap, "Alt");
xkb_mod_index_t controlMod = xkb_keymap_mod_get_index(xkb_keymap, "Control");
+ xkb_mod_index_t metaMod = xkb_keymap_mod_get_index(xkb_keymap, "Meta");
Q_ASSERT(shiftMod < 32);
Q_ASSERT(altMod < 32);
Q_ASSERT(controlMod < 32);
+ Q_ASSERT(metaMod < 32);
xkb_mod_mask_t depressed;
int qtKey = 0;
@@ -987,6 +989,8 @@
depressed |= (1 << shiftMod);
if (neededMods & Qt::ControlModifier)
depressed |= (1 << controlMod);
+ if (neededMods & Qt::MetaModifier)
+ depressed |= (1 << metaMod);
xkb_state_update_mask(kb_state, depressed, latchedMods, lockedMods, 0, 0, lockedLayout);
sym = xkb_state_key_get_one_sym(kb_state, keycode);
}