From b4de899b2c6a53fe4e5f22a635f28793116f055c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 11 Jul 2011 19:10:35 +0200 Subject: [PATCH] Fix broken creation of OverlayWindow The HAVE_XCOMPOSITE_OVERLAY define had not been moved to the new overlaywindow.cpp file causing the OverlayWindow to not be created at all. In fact after moving the define to the new file the code did not even compile as that code parts still used m_overlayWindow instead of m_window. The regression would have been easy to spot when testing with all backends as the GLES/EGL backend still requires the overlay window. CCMAIL: a.arlt@stud.uni-heidelberg.de --- composite.cpp | 3 --- overlaywindow.cpp | 17 +++++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/composite.cpp b/composite.cpp index 1c4b530cac..f594d1b2c7 100644 --- a/composite.cpp +++ b/composite.cpp @@ -69,9 +69,6 @@ along with this program. If not, see . #ifdef HAVE_XCOMPOSITE #include -#if XCOMPOSITE_MAJOR > 0 || XCOMPOSITE_MINOR >= 3 -#define HAVE_XCOMPOSITE_OVERLAY -#endif #endif #ifdef HAVE_XRANDR #include diff --git a/overlaywindow.cpp b/overlaywindow.cpp index 89fa65c74e..65db6dc591 100644 --- a/overlaywindow.cpp +++ b/overlaywindow.cpp @@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ +#include + #include "overlaywindow.h" #include "kwinglobals.h" @@ -28,6 +30,13 @@ along with this program. If not, see . #include +#ifdef HAVE_XCOMPOSITE +#include +#if XCOMPOSITE_MAJOR > 0 || XCOMPOSITE_MINOR >= 3 +#define HAVE_XCOMPOSITE_OVERLAY +#endif +#endif + namespace KWin { OverlayWindow::OverlayWindow() : m_window(None) @@ -48,10 +57,10 @@ bool OverlayWindow::create() if (!Extensions::shapeInputAvailable()) // needed in setupOverlay() return false; #ifdef HAVE_XCOMPOSITE_OVERLAY - m_overlay = XCompositeGetOverlayWindow(display(), rootWindow()); - if (m_overlay == None) + m_window = XCompositeGetOverlayWindow(display(), rootWindow()); + if (m_window == None) return false; - XResizeWindow(display(), m_overlay, displayWidth(), displayHeight()); + XResizeWindow(display(), m_window, displayWidth(), displayHeight()); return true; #else return false; @@ -132,7 +141,7 @@ void OverlayWindow::destroy() XShapeCombineRectangles(display(), m_window, ShapeBounding, 0, 0, &rec, 1, ShapeSet, Unsorted); XShapeCombineRectangles(display(), m_window, ShapeInput, 0, 0, &rec, 1, ShapeSet, Unsorted); #ifdef HAVE_XCOMPOSITE_OVERLAY - XCompositeReleaseOverlayWindow(display(), m_overlay); + XCompositeReleaseOverlayWindow(display(), m_window); #endif m_window = None; m_shown = false;