Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.76 KB | None | 0 0
  1. diff --git a/kwin/client.cpp b/kwin/client.cpp
  2. index 98c2b8c..9055c20 100644
  3. --- a/kwin/client.cpp
  4. +++ b/kwin/client.cpp
  5. @@ -582,24 +582,60 @@ void Client::resizeDecorationPixmaps()
  6. QRect lr, rr, tr, br;
  7. layoutDecorationRects(lr, tr, rr, br, DecorationRelative);
  8.  
  9. - if (decorationPixmapTop.size() != tr.size()) {
  10. - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), tr.width(), tr.height(), 32);
  11. - decorationPixmapTop = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
  12. + if (decorationPixmapTop.size() != tr.size())
  13. + {
  14. + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
  15. + decorationPixmapTop = QPixmap(tr.size());
  16. + }
  17. + else {
  18. + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
  19. + tr.size().width(), tr.height(),
  20. + 32);
  21. + decorationPixmapTop = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
  22. + decorationPixmapTop.fill(Qt::transparent);
  23. + }
  24. }
  25.  
  26. - if (decorationPixmapBottom.size() != br.size()) {
  27. - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), br.width(), br.height(), 32);
  28. - decorationPixmapBottom = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
  29. + if (decorationPixmapBottom.size() != br.size())
  30. + {
  31. + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
  32. + decorationPixmapBottom = QPixmap(br.size());
  33. + }
  34. + else {
  35. + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
  36. + br.size().width(), br.height(),
  37. + 32);
  38. + decorationPixmapBottom = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
  39. + decorationPixmapBottom.fill(Qt::transparent);
  40. + }
  41. }
  42.  
  43. - if (decorationPixmapLeft.size() != lr.size()) {
  44. - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), lr.width(), lr.height(), 32);
  45. - decorationPixmapLeft = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
  46. + if (decorationPixmapLeft.size() != lr.size())
  47. + {
  48. + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
  49. + decorationPixmapLeft = QPixmap(lr.size());
  50. + }
  51. + else {
  52. + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
  53. + lr.size().width(), lr.height(),
  54. + 32);
  55. + decorationPixmapLeft = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
  56. + decorationPixmapLeft.fill(Qt::transparent);
  57. + }
  58. }
  59.  
  60. - if (decorationPixmapRight.size() != rr.size()) {
  61. - Pixmap pixmap = XCreatePixmap(display(), rootWindow(), rr.width(), rr.height(), 32);
  62. - decorationPixmapRight = QPixmap::fromX11Pixmap(pixmap, QPixmap::ExplicitlyShared);
  63. + if (decorationPixmapRight.size() != rr.size())
  64. + {
  65. + if (workspace()->isCompositingActive() && effects->compositingType() == OpenGLCompositing) {
  66. + decorationPixmapRight = QPixmap(rr.size());
  67. + }
  68. + else {
  69. + Pixmap xpix = XCreatePixmap(QX11Info::display(), rootWindow(),
  70. + rr.size().width(), rr.height(),
  71. + 32);
  72. + decorationPixmapRight = QPixmap::fromX11Pixmap(xpix, QPixmap::ExplicitlyShared);
  73. + decorationPixmapRight.fill(Qt::transparent);
  74. + }
  75. }
  76.  
  77. #ifdef HAVE_XRENDER
  78. diff --git a/kwin/composite.cpp b/kwin/composite.cpp
  79. index 8d7fd84..a1fb4d4 100644
  80. --- a/kwin/composite.cpp
  81. +++ b/kwin/composite.cpp
  82. @@ -202,6 +202,7 @@ void Workspace::finishCompositing()
  83. #ifdef KWIN_HAVE_COMPOSITING
  84. if (scene == NULL)
  85. return;
  86. + finishingCompositing = true;
  87. delete cm_selection;
  88. foreach (Client * c, clients)
  89. scene->windowClosed(c, NULL);
  90. @@ -240,6 +241,7 @@ void Workspace::finishCompositing()
  91. // discard all Deleted windows (#152914)
  92. while (!deleted.isEmpty())
  93. deleted.first()->discard(Allowed);
  94. + finishingCompositing = false;
  95. #endif
  96. }
  97.  
  98. @@ -951,13 +953,14 @@ void Client::setupCompositing()
  99. {
  100. Toplevel::setupCompositing();
  101. updateVisibility(); // for internalKeep()
  102. + updateDecoration(true, true);
  103. }
  104.  
  105. void Client::finishCompositing()
  106. {
  107. Toplevel::finishCompositing();
  108. updateVisibility();
  109. - triggerDecorationRepaint();
  110. + updateDecoration(true, true);
  111. }
  112.  
  113. bool Client::shouldUnredirect() const
  114. diff --git a/kwin/workspace.cpp b/kwin/workspace.cpp
  115. index 81c8742..79f4054 100644
  116. --- a/kwin/workspace.cpp
  117. +++ b/kwin/workspace.cpp
  118. @@ -160,6 +160,7 @@ Workspace::Workspace(bool restore)
  119. , transSlider(NULL)
  120. , transButton(NULL)
  121. , forceUnredirectCheck(true)
  122. + , finishingCompositing (false)
  123. {
  124. (void) new KWinAdaptor(this);
  125.  
  126. diff --git a/kwin/workspace.h b/kwin/workspace.h
  127. index 8e639ff..802aeb5 100644
  128. --- a/kwin/workspace.h
  129. +++ b/kwin/workspace.h
  130. @@ -412,6 +412,11 @@ public:
  131. void unloadEffect(const QString& name);
  132. void updateCompositeBlocking(Client* c = NULL);
  133.  
  134. + bool isCompositingActive () const
  135. + {
  136. + return !finishingCompositing && compositing();
  137. + }
  138. +
  139. QStringList loadedEffects() const;
  140. QStringList listOfEffects() const;
  141.  
  142. @@ -1038,6 +1043,7 @@ private:
  143. bool forceUnredirectCheck;
  144. QList< int > composite_paint_times;
  145. QTimer compositeResetTimer; // for compressing composite resets
  146. + bool finishingCompositing;
  147.  
  148. Window outline_left;
  149. Window outline_right;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement