Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
Show First 20 Lines • Show All 1641 Lines • ▼ Show 20 Line(s) | 1625 | if (Application::usesLibinput()) { | |||
---|---|---|---|---|---|
1642 | } | 1642 | } | ||
1643 | } | 1643 | } | ||
1644 | connect(kwinApp(), &Application::workspaceCreated, this, &InputRedirection::setupWorkspace); | 1644 | connect(kwinApp(), &Application::workspaceCreated, this, &InputRedirection::setupWorkspace); | ||
1645 | reconfigure(); | 1645 | reconfigure(); | ||
1646 | } | 1646 | } | ||
1647 | 1647 | | |||
1648 | InputRedirection::~InputRedirection() | 1648 | InputRedirection::~InputRedirection() | ||
1649 | { | 1649 | { | ||
1650 | s_self = NULL; | 1650 | s_self = nullptr; | ||
1651 | qDeleteAll(m_filters); | 1651 | qDeleteAll(m_filters); | ||
1652 | qDeleteAll(m_spies); | 1652 | qDeleteAll(m_spies); | ||
1653 | } | 1653 | } | ||
1654 | 1654 | | |||
1655 | void InputRedirection::installInputEventFilter(InputEventFilter *filter) | 1655 | void InputRedirection::installInputEventFilter(InputEventFilter *filter) | ||
1656 | { | 1656 | { | ||
1657 | Q_ASSERT(!m_filters.contains(filter)); | 1657 | Q_ASSERT(!m_filters.contains(filter)); | ||
1658 | m_filters << filter; | 1658 | m_filters << filter; | ||
▲ Show 20 Lines • Show All 465 Lines • ▼ Show 20 Line(s) | |||||
2124 | Toplevel *InputRedirection::findManagedToplevel(const QPoint &pos) | 2124 | Toplevel *InputRedirection::findManagedToplevel(const QPoint &pos) | ||
2125 | { | 2125 | { | ||
2126 | if (!Workspace::self()) { | 2126 | if (!Workspace::self()) { | ||
2127 | return nullptr; | 2127 | return nullptr; | ||
2128 | } | 2128 | } | ||
2129 | const bool isScreenLocked = waylandServer() && waylandServer()->isScreenLocked(); | 2129 | const bool isScreenLocked = waylandServer() && waylandServer()->isScreenLocked(); | ||
2130 | const ToplevelList &stacking = Workspace::self()->stackingOrder(); | 2130 | const ToplevelList &stacking = Workspace::self()->stackingOrder(); | ||
2131 | if (stacking.isEmpty()) { | 2131 | if (stacking.isEmpty()) { | ||
2132 | return NULL; | 2132 | return nullptr; | ||
2133 | } | 2133 | } | ||
2134 | auto it = stacking.end(); | 2134 | auto it = stacking.end(); | ||
2135 | do { | 2135 | do { | ||
2136 | --it; | 2136 | --it; | ||
2137 | Toplevel *t = (*it); | 2137 | Toplevel *t = (*it); | ||
2138 | if (t->isDeleted()) { | 2138 | if (t->isDeleted()) { | ||
2139 | // a deleted window doesn't get mouse events | 2139 | // a deleted window doesn't get mouse events | ||
2140 | continue; | 2140 | continue; | ||
Show All 10 Lines | 2150 | if (isScreenLocked) { | |||
2151 | if (!t->isLockScreen() && !t->isInputMethod()) { | 2151 | if (!t->isLockScreen() && !t->isInputMethod()) { | ||
2152 | continue; | 2152 | continue; | ||
2153 | } | 2153 | } | ||
2154 | } | 2154 | } | ||
2155 | if (t->inputGeometry().contains(pos) && acceptsInput(t, pos)) { | 2155 | if (t->inputGeometry().contains(pos) && acceptsInput(t, pos)) { | ||
2156 | return t; | 2156 | return t; | ||
2157 | } | 2157 | } | ||
2158 | } while (it != stacking.begin()); | 2158 | } while (it != stacking.begin()); | ||
2159 | return NULL; | 2159 | return nullptr; | ||
2160 | } | 2160 | } | ||
2161 | 2161 | | |||
2162 | Qt::KeyboardModifiers InputRedirection::keyboardModifiers() const | 2162 | Qt::KeyboardModifiers InputRedirection::keyboardModifiers() const | ||
2163 | { | 2163 | { | ||
2164 | return m_keyboard->modifiers(); | 2164 | return m_keyboard->modifiers(); | ||
2165 | } | 2165 | } | ||
2166 | 2166 | | |||
2167 | Qt::KeyboardModifiers InputRedirection::modifiersRelevantForGlobalShortcuts() const | 2167 | Qt::KeyboardModifiers InputRedirection::modifiersRelevantForGlobalShortcuts() const | ||
▲ Show 20 Lines • Show All 259 Lines • Show Last 20 Lines |