Changeset View
Changeset View
Standalone View
Standalone View
tabbox/tabbox.cpp
Show All 30 Lines | |||||
31 | #include "tabbox/tabbox_logging.h" | 31 | #include "tabbox/tabbox_logging.h" | ||
32 | // kwin | 32 | // kwin | ||
33 | #ifdef KWIN_BUILD_ACTIVITIES | 33 | #ifdef KWIN_BUILD_ACTIVITIES | ||
34 | #include "activities.h" | 34 | #include "activities.h" | ||
35 | #endif | 35 | #endif | ||
36 | #include "client.h" | 36 | #include "client.h" | ||
37 | #include "effects.h" | 37 | #include "effects.h" | ||
38 | #include "input.h" | 38 | #include "input.h" | ||
39 | #include "keyboard_input.h" | ||||
39 | #include "focuschain.h" | 40 | #include "focuschain.h" | ||
40 | #include "screenedge.h" | 41 | #include "screenedge.h" | ||
41 | #include "screens.h" | 42 | #include "screens.h" | ||
42 | #include "unmanaged.h" | 43 | #include "unmanaged.h" | ||
43 | #include "virtualdesktops.h" | 44 | #include "virtualdesktops.h" | ||
44 | #include "workspace.h" | 45 | #include "workspace.h" | ||
45 | #include "xcbutils.h" | 46 | #include "xcbutils.h" | ||
46 | // Qt | 47 | // Qt | ||
▲ Show 20 Lines • Show All 446 Lines • ▼ Show 20 Line(s) | 457 | { | |||
493 | m_desktopListConfig.setShowDesktopMode(TabBoxConfig::DoNotShowDesktopClient); | 494 | m_desktopListConfig.setShowDesktopMode(TabBoxConfig::DoNotShowDesktopClient); | ||
494 | m_desktopListConfig.setDesktopSwitchingMode(TabBoxConfig::StaticDesktopSwitching); | 495 | m_desktopListConfig.setDesktopSwitchingMode(TabBoxConfig::StaticDesktopSwitching); | ||
495 | m_tabBox = new TabBoxHandlerImpl(this); | 496 | m_tabBox = new TabBoxHandlerImpl(this); | ||
496 | QTimer::singleShot(0, this, SLOT(handlerReady())); | 497 | QTimer::singleShot(0, this, SLOT(handlerReady())); | ||
497 | 498 | | |||
498 | m_tabBoxMode = TabBoxDesktopMode; // init variables | 499 | m_tabBoxMode = TabBoxDesktopMode; // init variables | ||
499 | connect(&m_delayedShowTimer, SIGNAL(timeout()), this, SLOT(show())); | 500 | connect(&m_delayedShowTimer, SIGNAL(timeout()), this, SLOT(show())); | ||
500 | connect(Workspace::self(), SIGNAL(configChanged()), this, SLOT(reconfigure())); | 501 | connect(Workspace::self(), SIGNAL(configChanged()), this, SLOT(reconfigure())); | ||
501 | | ||||
502 | connect(input(), &InputRedirection::keyboardModifiersChanged, this, &TabBox::modifiersChanged); | | |||
503 | } | 502 | } | ||
504 | 503 | | |||
505 | TabBox::~TabBox() | 504 | TabBox::~TabBox() | ||
506 | { | 505 | { | ||
507 | s_self = nullptr; | 506 | s_self = nullptr; | ||
508 | } | 507 | } | ||
509 | 508 | | |||
510 | void TabBox::handlerReady() | 509 | void TabBox::handlerReady() | ||
▲ Show 20 Lines • Show All 560 Lines • ▼ Show 20 Line(s) | 1045 | { | |||
1071 | } | 1070 | } | ||
1072 | 1071 | | |||
1073 | return areKeySymXsDepressed(false, rgKeySyms, nKeySyms); | 1072 | return areKeySymXsDepressed(false, rgKeySyms, nKeySyms); | ||
1074 | } | 1073 | } | ||
1075 | 1074 | | |||
1076 | static bool areModKeysDepressedWayland(const QKeySequence &seq) | 1075 | static bool areModKeysDepressedWayland(const QKeySequence &seq) | ||
1077 | { | 1076 | { | ||
1078 | const int mod = seq[seq.count()-1] & Qt::KeyboardModifierMask; | 1077 | const int mod = seq[seq.count()-1] & Qt::KeyboardModifierMask; | ||
1079 | const Qt::KeyboardModifiers mods = input()->keyboardModifiers(); | 1078 | const Qt::KeyboardModifiers mods = input()->keyboard()->xkb()->modifiersRelevantForGlobalShortcuts(); | ||
1080 | if ((mod & Qt::SHIFT) && mods.testFlag(Qt::ShiftModifier)) { | 1079 | if ((mod & Qt::SHIFT) && mods.testFlag(Qt::ShiftModifier)) { | ||
1081 | return true; | 1080 | return true; | ||
1082 | } | 1081 | } | ||
1083 | if ((mod & Qt::CTRL) && mods.testFlag(Qt::ControlModifier)) { | 1082 | if ((mod & Qt::CTRL) && mods.testFlag(Qt::ControlModifier)) { | ||
1084 | return true; | 1083 | return true; | ||
1085 | } | 1084 | } | ||
1086 | if ((mod & Qt::ALT) && mods.testFlag(Qt::AltModifier)) { | 1085 | if ((mod & Qt::ALT) && mods.testFlag(Qt::AltModifier)) { | ||
1087 | return true; | 1086 | return true; | ||
▲ Show 20 Lines • Show All 477 Lines • ▼ Show 20 Line(s) | 1560 | if (m_desktopGrab) { | |||
1565 | m_tabGrab = old_tab_grab; | 1564 | m_tabGrab = old_tab_grab; | ||
1566 | if (desktop != -1) { | 1565 | if (desktop != -1) { | ||
1567 | setCurrentDesktop(desktop); | 1566 | setCurrentDesktop(desktop); | ||
1568 | VirtualDesktopManager::self()->setCurrent(desktop); | 1567 | VirtualDesktopManager::self()->setCurrent(desktop); | ||
1569 | } | 1568 | } | ||
1570 | } | 1569 | } | ||
1571 | } | 1570 | } | ||
1572 | 1571 | | |||
1573 | void TabBox::modifiersChanged(Qt::KeyboardModifiers mods) | 1572 | void TabBox::modifiersReleased() | ||
1574 | { | 1573 | { | ||
1575 | if (m_noModifierGrab || !(!mods)) { | 1574 | if (m_noModifierGrab) { | ||
1576 | return; | 1575 | return; | ||
1577 | } | 1576 | } | ||
1578 | if (m_tabGrab) { | 1577 | if (m_tabGrab) { | ||
1579 | bool old_control_grab = m_desktopGrab; | 1578 | bool old_control_grab = m_desktopGrab; | ||
1580 | accept(); | 1579 | accept(); | ||
1581 | m_desktopGrab = old_control_grab; | 1580 | m_desktopGrab = old_control_grab; | ||
1582 | } | 1581 | } | ||
1583 | if (m_desktopGrab) { | 1582 | if (m_desktopGrab) { | ||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |