From 79c3fa55f2b540d9b8b53012c775d6b385de8161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 24 Jan 2014 22:29:30 +0100 Subject: [PATCH 1/6] merge buffer_age render into general render code avoiding the blocking swapinterval detection causes issues in the timing strategy and prevents protection against CPU overload on the nvidia blob BUG: 329821 FIXED-IN: 4.11.6 REVIEW: 115306 --- eglonxbackend.cpp | 18 ++++++++---------- glxbackend.cpp | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/eglonxbackend.cpp b/eglonxbackend.cpp index 781f09b40e..f2c6467cc4 100644 --- a/eglonxbackend.cpp +++ b/eglonxbackend.cpp @@ -279,15 +279,8 @@ void EglOnXBackend::present() if (lastDamage().isEmpty()) return; - if (supportsBufferAge()) { - eglSwapBuffers(dpy, surface); - eglQuerySurface(dpy, surface, EGL_BUFFER_AGE_EXT, &m_bufferAge); - setLastDamage(QRegion()); - return; - } - const QRegion displayRegion(0, 0, displayWidth(), displayHeight()); - const bool fullRepaint = (lastDamage() == displayRegion); + const bool fullRepaint = supportsBufferAge() || (lastDamage() == displayRegion); if (fullRepaint || !surfaceHasSubPost) { if (gs_tripleBufferNeedsDetection) { @@ -315,6 +308,9 @@ void EglOnXBackend::present() setBlocksForRetrace(result == 'd'); } } + if (supportsBufferAge()) { + eglQuerySurface(dpy, surface, EGL_BUFFER_AGE_EXT, &m_bufferAge); + } } else { // a part of the screen changed, and we can use eglPostSubBufferNV to copy the updated area foreach (const QRect & r, lastDamage().rects()) { @@ -323,8 +319,10 @@ void EglOnXBackend::present() } setLastDamage(QRegion()); - eglWaitGL(); - xcb_flush(connection()); + if (!supportsBufferAge()) { + eglWaitGL(); + xcb_flush(connection()); + } } void EglOnXBackend::screenGeometryChanged(const QSize &size) diff --git a/glxbackend.cpp b/glxbackend.cpp index 269da58c0e..ef2a989d87 100644 --- a/glxbackend.cpp +++ b/glxbackend.cpp @@ -438,15 +438,8 @@ void GlxBackend::present() if (lastDamage().isEmpty()) return; - if (supportsBufferAge()) { - glXSwapBuffers(display(), glxWindow); - glXQueryDrawable(display(), glxWindow, GLX_BACK_BUFFER_AGE_EXT, (GLuint *) &m_bufferAge); - setLastDamage(QRegion()); - return; - } - const QRegion displayRegion(0, 0, displayWidth(), displayHeight()); - const bool fullRepaint = (lastDamage() == displayRegion); + const bool fullRepaint = supportsBufferAge() || (lastDamage() == displayRegion); if (fullRepaint) { if (haveSwapInterval) { @@ -478,6 +471,9 @@ void GlxBackend::present() waitSync(); glXSwapBuffers(display(), glxWindow); } + if (supportsBufferAge()) { + glXQueryDrawable(display(), glxWindow, GLX_BACK_BUFFER_AGE_EXT, (GLuint *) &m_bufferAge); + } } else if (glXCopySubBuffer) { foreach (const QRect & r, lastDamage().rects()) { // convert to OpenGL coordinates @@ -490,9 +486,11 @@ void GlxBackend::present() glDrawBuffer(GL_BACK); } - glXWaitGL(); setLastDamage(QRegion()); - XFlush(display()); + if (!supportsBufferAge()) { + glXWaitGL(); + XFlush(display()); + } } void GlxBackend::screenGeometryChanged(const QSize &size) From edf0ed895f87d77bfdfbef2318cbbbf278043ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 24 Jan 2014 22:31:46 +0100 Subject: [PATCH 2/6] 1-pass change maximized <-> quicktiled geometry REVIEW: 115307 --- geometry.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/geometry.cpp b/geometry.cpp index 13b157d21e..45c419c1ac 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -3143,6 +3143,8 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) if (!isResizable() && maximizeMode() != MaximizeFull) return; + GeometryUpdatesBlocker blocker(this); + if (mode == QuickTileMaximize) { TabSynchronizer syncer(this, TabGroup::QuickTile|TabGroup::Geometry|TabGroup::Maximized); quick_tile_mode = QuickTileNone; From 50325209208fe905b653878d7872b327080eb831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 11 Jan 2014 12:50:08 +0100 Subject: [PATCH 3/6] cut spurious \0 byte from string properties added with 26c263cc1de9cf0af66c12d0d746cd8ae7b1744a CCBUG: 326893 FIXED-IN: 4.11.6 REVIEW: 114963 --- utils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.cpp b/utils.cpp index f725a0e1d4..588634f2d2 100644 --- a/utils.cpp +++ b/utils.cpp @@ -129,14 +129,17 @@ QByteArray getStringProperty(xcb_window_t w, xcb_atom_t prop, char separator) return QByteArray(); } char *data = static_cast(xcb_get_property_value(property.data())); + int length = property->value_len; if (data && separator) { for (uint32_t i = 0; i < property->value_len; ++i) { if (!data[i] && i + 1 < property->value_len) { data[i] = separator; + } else { + length = i; } } } - return QByteArray(data, property->value_len); + return QByteArray(data, length); } #ifndef KCMRULES From 374ea9091efc7860f71aadbf1a6457f3a57fb8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 11 Jan 2014 12:52:10 +0100 Subject: [PATCH 4/6] remove clientMachine from session handling since the hostname is resolved asynchronous, testing it can easily fail CCBUG: 326893 FIXED-IN: 4.11.6 REVIEW: 114963 --- sm.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sm.cpp b/sm.cpp index 1e90eb63cf..34efa9d98b 100644 --- a/sm.cpp +++ b/sm.cpp @@ -121,7 +121,6 @@ void Workspace::storeClient(KConfigGroup &cg, int num, Client *c) cg.writeEntry(QString("sessionId") + n, c->sessionId().constData()); cg.writeEntry(QString("windowRole") + n, c->windowRole().constData()); cg.writeEntry(QString("wmCommand") + n, c->wmCommand().constData()); - cg.writeEntry(QString("wmClientMachine") + n, c->wmClientMachine(true).constData()); cg.writeEntry(QString("resourceName") + n, c->resourceName().constData()); cg.writeEntry(QString("resourceClass") + n, c->resourceClass().constData()); cg.writeEntry(QString("geometry") + n, QRect(c->calculateGravitation(true), c->clientSize())); // FRAME @@ -206,7 +205,6 @@ void Workspace::addSessionInfo(KConfigGroup &cg) info->sessionId = cg.readEntry(QString("sessionId") + n, QString()).toLatin1(); info->windowRole = cg.readEntry(QString("windowRole") + n, QString()).toLatin1(); info->wmCommand = cg.readEntry(QString("wmCommand") + n, QString()).toLatin1(); - info->wmClientMachine = cg.readEntry(QString("wmClientMachine") + n, QString()).toLatin1(); info->resourceName = cg.readEntry(QString("resourceName") + n, QString()).toLatin1(); info->resourceClass = cg.readEntry(QString("resourceClass") + n, QString()).toLower().toLatin1(); info->geometry = cg.readEntry(QString("geometry") + n, QRect()); @@ -256,7 +254,6 @@ SessionInfo* Workspace::takeSessionInfo(Client* c) QByteArray sessionId = c->sessionId(); QByteArray windowRole = c->windowRole(); QByteArray wmCommand = c->wmCommand(); - QByteArray wmClientMachine = c->wmClientMachine(true); QByteArray resourceName = c->resourceName(); QByteArray resourceClass = c->resourceClass(); @@ -289,7 +286,6 @@ SessionInfo* Workspace::takeSessionInfo(Client* c) break; if (info->resourceName == resourceName && info->resourceClass == resourceClass - && info->wmClientMachine == wmClientMachine && sessionInfoWindowTypeMatch(c, info)) { if (wmCommand.isEmpty() || info->wmCommand == wmCommand) { realInfo = info; From 6bd74cebf34d40d6eded4dc65c3b8f65d3a91855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 1 Dec 2013 22:12:25 +0100 Subject: [PATCH 5/6] no autogrouping if deco doesn't support it BUG: 328272 FIXED-IN: 4.11.6 REVIEW: 115308 --- manage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manage.cpp b/manage.cpp index 41a525c871..473d17e9d5 100644 --- a/manage.cpp +++ b/manage.cpp @@ -31,6 +31,7 @@ along with this program. If not, see . #include "activities.h" #endif #include "cursor.h" +#include "decorations.h" #include #include "rules.h" #include "group.h" @@ -319,7 +320,7 @@ bool Client::manage(xcb_window_t w, bool isMapped) // Create client group if the window will have a decoration bool dontKeepInArea = false; setTabGroup(NULL); - if (!noBorder()) { + if (!noBorder() && DecorationPlugin::self()->supportsTabbing()) { const bool autogrouping = rules()->checkAutogrouping(options->isAutogroupSimilarWindows()); const bool autogroupInFg = rules()->checkAutogroupInForeground(options->isAutogroupInForeground()); // Automatically add to previous groups on session restore From 23ae01ffd9dcadcce568bf525d1cb65b96f034a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 24 Jan 2014 22:32:53 +0100 Subject: [PATCH 6/6] full repaints in logout effect REVIEW: 115276 --- effects/logout/logout.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index 454bcf5a3e..6a53e4d9ac 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -149,6 +149,7 @@ void LogoutEffect::prePaintScreen(ScreenPrePaintData& data, int time) data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS; } + data.paint |= effects->clientArea(FullArea, 0, 0); effects->prePaintScreen(data, time); }