Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/x11/standalone/edge.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | |||||
105 | 105 | | |||
106 | void WindowBasedEdge::doStartApproaching() | 106 | void WindowBasedEdge::doStartApproaching() | ||
107 | { | 107 | { | ||
108 | if (!activatesForPointer()) { | 108 | if (!activatesForPointer()) { | ||
109 | return; | 109 | return; | ||
110 | } | 110 | } | ||
111 | m_approachWindow.unmap(); | 111 | m_approachWindow.unmap(); | ||
112 | Cursor *cursor = Cursor::self(); | 112 | Cursor *cursor = Cursor::self(); | ||
113 | connect(cursor, SIGNAL(posChanged(QPoint)), SLOT(updateApproaching(QPoint))); | 113 | #ifndef KWIN_UNIT_TEST | ||
114 | m_cursorPollingConnection = connect(cursor, &Cursor::posChanged, this, &WindowBasedEdge::updateApproaching); | ||||
115 | #endif | ||||
114 | cursor->startMousePolling(); | 116 | cursor->startMousePolling(); | ||
115 | } | 117 | } | ||
116 | 118 | | |||
117 | void WindowBasedEdge::doStopApproaching() | 119 | void WindowBasedEdge::doStopApproaching() | ||
118 | { | 120 | { | ||
119 | if (!activatesForPointer()) { | 121 | if (!m_cursorPollingConnection) { | ||
120 | return; | 122 | return; | ||
121 | } | 123 | } | ||
122 | Cursor *cursor = Cursor::self(); | 124 | disconnect(m_cursorPollingConnection); | ||
123 | disconnect(cursor, SIGNAL(posChanged(QPoint)), this, SLOT(updateApproaching(QPoint))); | 125 | m_cursorPollingConnection = QMetaObject::Connection(); | ||
124 | cursor->stopMousePolling(); | 126 | Cursor::self()->stopMousePolling(); | ||
125 | m_approachWindow.map(); | 127 | m_approachWindow.map(); | ||
126 | } | 128 | } | ||
127 | 129 | | |||
128 | void WindowBasedEdge::doUpdateBlocking() | 130 | void WindowBasedEdge::doUpdateBlocking() | ||
129 | { | 131 | { | ||
130 | if (!isReserved()) { | 132 | if (!isReserved()) { | ||
131 | return; | 133 | return; | ||
132 | } | 134 | } | ||
Show All 10 Lines |