Merge branch 'Plasma/5.10'

icc-effect-5.14.5
Martin Flöser 2017-07-06 19:13:41 +02:00
commit 46085d3bda
4 changed files with 20 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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();
}

View File

@ -61,6 +61,7 @@ private:
void createApproachWindow();
Xcb::Window m_window;
Xcb::Window m_approachWindow;
QMetaObject::Connection m_cursorPollingConnection;
};
inline quint32 WindowBasedEdge::window() const