Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/kwin/client.cpp b/kwin/client.cpp
- index 98c2b8c..0fe11f3 100644
- --- a/kwin/client.cpp
- +++ b/kwin/client.cpp
- @@ -583,23 +583,51 @@ void Client::resizeDecorationPixmaps()
- layoutDecorationRects(lr, tr, rr, br, DecorationRelative);
- if (decorationPixmapTop.size() != tr.size()) {
- - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), tr.width(), tr.height(), 32);
- - decorationPixmapTop = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
- + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
- + decorationPixmapTop = QPixmap(tr.size());
- + } else {
- + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
- + tr.size().width(), tr.height(),
- + 32);
- + decorationPixmapTop = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
- + decorationPixmapTop.fill(Qt::transparent);
- + }
- }
- if (decorationPixmapBottom.size() != br.size()) {
- - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), br.width(), br.height(), 32);
- - decorationPixmapBottom = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
- + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
- + decorationPixmapBottom = QPixmap(br.size());
- + } else {
- + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
- + br.size().width(), br.height(),
- + 32);
- + decorationPixmapBottom = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
- + decorationPixmapBottom.fill(Qt::transparent);
- + }
- }
- if (decorationPixmapLeft.size() != lr.size()) {
- - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), lr.width(), lr.height(), 32);
- - decorationPixmapLeft = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
- + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
- + decorationPixmapLeft = QPixmap(lr.size());
- + } else {
- + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
- + lr.size().width(), lr.height(),
- + 32);
- + decorationPixmapLeft = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
- + decorationPixmapLeft.fill(Qt::transparent);
- + }
- }
- if (decorationPixmapRight.size() != rr.size()) {
- - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), rr.width(), rr.height(), 32);
- - decorationPixmapRight = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
- + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
- + decorationPixmapRight = QPixmap(rr.size());
- + } else {
- + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
- + rr.size().width(), rr.height(),
- + 32);
- + decorationPixmapRight = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
- + decorationPixmapRight.fill(Qt::transparent);
- + }
- }
- #ifdef HAVE_XRENDER
- diff --git a/kwin/composite.cpp b/kwin/composite.cpp
- index 8d7fd84..d2b1937 100644
- --- a/kwin/composite.cpp
- +++ b/kwin/composite.cpp
- @@ -202,6 +202,7 @@ void Workspace::finishCompositing()
- #ifdef KWIN_HAVE_COMPOSITING
- if (scene == NULL)
- return;
- + m_finishingCompositing = true;
- delete cm_selection;
- foreach (Client * c, clients)
- scene->windowClosed(c, NULL);
- @@ -240,6 +241,7 @@ void Workspace::finishCompositing()
- // discard all Deleted windows (#152914)
- while (!deleted.isEmpty())
- deleted.first()->discard(Allowed);
- + m_finishingCompositing = false;
- #endif
- }
- @@ -951,13 +953,14 @@ void Client::setupCompositing()
- {
- Toplevel::setupCompositing();
- updateVisibility(); // for internalKeep()
- + updateDecoration(true, true);
- }
- void Client::finishCompositing()
- {
- Toplevel::finishCompositing();
- updateVisibility();
- - triggerDecorationRepaint();
- + updateDecoration(true, true);
- }
- bool Client::shouldUnredirect() const
- diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp
- index 81c8742..885a3ab 100644
- --- a/kwin/workspace.cpp
- +++ b/kwin/workspace.cpp
- @@ -160,6 +160,7 @@ Workspace::Workspace(bool restore)
- , transSlider(NULL)
- , transButton(NULL)
- , forceUnredirectCheck(true)
- + , m_finishingCompositing(false)
- {
- (void) new KWinAdaptor(this);
- diff --git a/kwin/workspace.h b/kwin/workspace.h
- index 8e639ff..9ba5bed 100644
- --- a/kwin/workspace.h
- +++ b/kwin/workspace.h
- @@ -412,6 +412,11 @@ public:
- void unloadEffect(const QString& name);
- void updateCompositeBlocking(Client* c = NULL);
- + bool isCompositingActive() const
- + {
- + return !m_finishingCompositing && compositing();
- + }
- +
- QStringList loadedEffects() const;
- QStringList listOfEffects() const;
- @@ -1038,6 +1043,7 @@ private:
- bool forceUnredirectCheck;
- QList< int > composite_paint_times;
- QTimer compositeResetTimer; // for compressing composite resets
- + bool m_finishingCompositing; // finishCompositing() sets this variable while shutting down
- Window outline_left;
- Window outline_right;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement