Merge branch 'Plasma/5.10'
commit
46085d3bda
|
@ -307,8 +307,11 @@ bool SlideBackEffect::intersects(EffectWindow* windowUnder, const QRect &windowO
|
||||||
EffectWindowList SlideBackEffect::usableWindows(const EffectWindowList & allWindows)
|
EffectWindowList SlideBackEffect::usableWindows(const EffectWindowList & allWindows)
|
||||||
{
|
{
|
||||||
EffectWindowList retList;
|
EffectWindowList retList;
|
||||||
|
auto isWindowVisible = [] (const EffectWindow *window) {
|
||||||
|
return window && effects->virtualScreenGeometry().intersects(window->geometry());
|
||||||
|
};
|
||||||
foreach (EffectWindow * tmp, allWindows) {
|
foreach (EffectWindow * tmp, allWindows) {
|
||||||
if (isWindowUsable(tmp)) {
|
if (isWindowUsable(tmp) && isWindowVisible(tmp)) {
|
||||||
retList.append(tmp);
|
retList.append(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,11 +128,19 @@ static QString formatGLError(GLenum err)
|
||||||
bool checkGLError(const char* txt)
|
bool checkGLError(const char* txt)
|
||||||
{
|
{
|
||||||
GLenum err = glGetError();
|
GLenum err = glGetError();
|
||||||
|
if (err == GL_CONTEXT_LOST) {
|
||||||
|
qCWarning(LIBKWINGLUTILS) << "GL error: context lost";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
bool hasError = false;
|
bool hasError = false;
|
||||||
while (err != GL_NO_ERROR) {
|
while (err != GL_NO_ERROR) {
|
||||||
qCWarning(LIBKWINGLUTILS) << "GL error (" << txt << "): " << formatGLError(err);
|
qCWarning(LIBKWINGLUTILS) << "GL error (" << txt << "): " << formatGLError(err);
|
||||||
hasError = true;
|
hasError = true;
|
||||||
err = glGetError();
|
err = glGetError();
|
||||||
|
if (err == GL_CONTEXT_LOST) {
|
||||||
|
qCWarning(LIBKWINGLUTILS) << "GL error: context lost";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return hasError;
|
return hasError;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,18 +110,20 @@ void WindowBasedEdge::doStartApproaching()
|
||||||
}
|
}
|
||||||
m_approachWindow.unmap();
|
m_approachWindow.unmap();
|
||||||
Cursor *cursor = Cursor::self();
|
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();
|
cursor->startMousePolling();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowBasedEdge::doStopApproaching()
|
void WindowBasedEdge::doStopApproaching()
|
||||||
{
|
{
|
||||||
if (!activatesForPointer()) {
|
if (!m_cursorPollingConnection) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Cursor *cursor = Cursor::self();
|
disconnect(m_cursorPollingConnection);
|
||||||
disconnect(cursor, SIGNAL(posChanged(QPoint)), this, SLOT(updateApproaching(QPoint)));
|
m_cursorPollingConnection = QMetaObject::Connection();
|
||||||
cursor->stopMousePolling();
|
Cursor::self()->stopMousePolling();
|
||||||
m_approachWindow.map();
|
m_approachWindow.map();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ private:
|
||||||
void createApproachWindow();
|
void createApproachWindow();
|
||||||
Xcb::Window m_window;
|
Xcb::Window m_window;
|
||||||
Xcb::Window m_approachWindow;
|
Xcb::Window m_approachWindow;
|
||||||
|
QMetaObject::Connection m_cursorPollingConnection;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline quint32 WindowBasedEdge::window() const
|
inline quint32 WindowBasedEdge::window() const
|
||||||
|
|
Loading…
Reference in New Issue