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
This commit is contained in:
Martin Gräßlin 2011-07-11 19:10:35 +02:00
parent b44580f02e
commit b4de899b2c
2 changed files with 13 additions and 7 deletions

View file

@ -69,9 +69,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef HAVE_XCOMPOSITE #ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h> #include <X11/extensions/Xcomposite.h>
#if XCOMPOSITE_MAJOR > 0 || XCOMPOSITE_MINOR >= 3
#define HAVE_XCOMPOSITE_OVERLAY
#endif
#endif #endif
#ifdef HAVE_XRANDR #ifdef HAVE_XRANDR
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>

View file

@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
#include <config-X11.h>
#include "overlaywindow.h" #include "overlaywindow.h"
#include "kwinglobals.h" #include "kwinglobals.h"
@ -28,6 +30,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/extensions/shape.h> #include <X11/extensions/shape.h>
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
#if XCOMPOSITE_MAJOR > 0 || XCOMPOSITE_MINOR >= 3
#define HAVE_XCOMPOSITE_OVERLAY
#endif
#endif
namespace KWin { namespace KWin {
OverlayWindow::OverlayWindow() OverlayWindow::OverlayWindow()
: m_window(None) : m_window(None)
@ -48,10 +57,10 @@ bool OverlayWindow::create()
if (!Extensions::shapeInputAvailable()) // needed in setupOverlay() if (!Extensions::shapeInputAvailable()) // needed in setupOverlay()
return false; return false;
#ifdef HAVE_XCOMPOSITE_OVERLAY #ifdef HAVE_XCOMPOSITE_OVERLAY
m_overlay = XCompositeGetOverlayWindow(display(), rootWindow()); m_window = XCompositeGetOverlayWindow(display(), rootWindow());
if (m_overlay == None) if (m_window == None)
return false; return false;
XResizeWindow(display(), m_overlay, displayWidth(), displayHeight()); XResizeWindow(display(), m_window, displayWidth(), displayHeight());
return true; return true;
#else #else
return false; return false;
@ -132,7 +141,7 @@ void OverlayWindow::destroy()
XShapeCombineRectangles(display(), m_window, ShapeBounding, 0, 0, &rec, 1, ShapeSet, Unsorted); XShapeCombineRectangles(display(), m_window, ShapeBounding, 0, 0, &rec, 1, ShapeSet, Unsorted);
XShapeCombineRectangles(display(), m_window, ShapeInput, 0, 0, &rec, 1, ShapeSet, Unsorted); XShapeCombineRectangles(display(), m_window, ShapeInput, 0, 0, &rec, 1, ShapeSet, Unsorted);
#ifdef HAVE_XCOMPOSITE_OVERLAY #ifdef HAVE_XCOMPOSITE_OVERLAY
XCompositeReleaseOverlayWindow(display(), m_overlay); XCompositeReleaseOverlayWindow(display(), m_window);
#endif #endif
m_window = None; m_window = None;
m_shown = false; m_shown = false;