Advertisement
Guest User

Untitled

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