diff --git a/effects/slideback/slideback.cpp b/effects/slideback/slideback.cpp index e7313c0cbf..a3bbe2ed67 100644 --- a/effects/slideback/slideback.cpp +++ b/effects/slideback/slideback.cpp @@ -307,8 +307,11 @@ bool SlideBackEffect::intersects(EffectWindow* windowUnder, const QRect &windowO EffectWindowList SlideBackEffect::usableWindows(const EffectWindowList & allWindows) { EffectWindowList retList; + auto isWindowVisible = [] (const EffectWindow *window) { + return window && effects->virtualScreenGeometry().intersects(window->geometry()); + }; foreach (EffectWindow * tmp, allWindows) { - if (isWindowUsable(tmp)) { + if (isWindowUsable(tmp) && isWindowVisible(tmp)) { retList.append(tmp); } } diff --git a/libkwineffects/kwinglutils.cpp b/libkwineffects/kwinglutils.cpp index 8f7ce38ca0..11a8163ea3 100644 --- a/libkwineffects/kwinglutils.cpp +++ b/libkwineffects/kwinglutils.cpp @@ -128,11 +128,19 @@ static QString formatGLError(GLenum err) bool checkGLError(const char* txt) { GLenum err = glGetError(); + if (err == GL_CONTEXT_LOST) { + qCWarning(LIBKWINGLUTILS) << "GL error: context lost"; + return true; + } bool hasError = false; while (err != GL_NO_ERROR) { qCWarning(LIBKWINGLUTILS) << "GL error (" << txt << "): " << formatGLError(err); hasError = true; err = glGetError(); + if (err == GL_CONTEXT_LOST) { + qCWarning(LIBKWINGLUTILS) << "GL error: context lost"; + break; + } } return hasError; } diff --git a/plugins/platforms/x11/standalone/edge.cpp b/plugins/platforms/x11/standalone/edge.cpp index f4331fabc5..700d086849 100644 --- a/plugins/platforms/x11/standalone/edge.cpp +++ b/plugins/platforms/x11/standalone/edge.cpp @@ -110,18 +110,20 @@ void WindowBasedEdge::doStartApproaching() } m_approachWindow.unmap(); Cursor *cursor = Cursor::self(); - connect(cursor, SIGNAL(posChanged(QPoint)), SLOT(updateApproaching(QPoint))); +#ifndef KWIN_UNIT_TEST + m_cursorPollingConnection = connect(cursor, &Cursor::posChanged, this, &WindowBasedEdge::updateApproaching); +#endif cursor->startMousePolling(); } void WindowBasedEdge::doStopApproaching() { - if (!activatesForPointer()) { + if (!m_cursorPollingConnection) { return; } - Cursor *cursor = Cursor::self(); - disconnect(cursor, SIGNAL(posChanged(QPoint)), this, SLOT(updateApproaching(QPoint))); - cursor->stopMousePolling(); + disconnect(m_cursorPollingConnection); + m_cursorPollingConnection = QMetaObject::Connection(); + Cursor::self()->stopMousePolling(); m_approachWindow.map(); } diff --git a/plugins/platforms/x11/standalone/edge.h b/plugins/platforms/x11/standalone/edge.h index 980c8b3ae8..6934b7dcbd 100644 --- a/plugins/platforms/x11/standalone/edge.h +++ b/plugins/platforms/x11/standalone/edge.h @@ -61,6 +61,7 @@ private: void createApproachWindow(); Xcb::Window m_window; Xcb::Window m_approachWindow; + QMetaObject::Connection m_cursorPollingConnection; }; inline quint32 WindowBasedEdge::window() const