From 7a1fe42be06c22714af90028f67ca1fc3795b1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 27 Aug 2012 19:45:01 +0200 Subject: [PATCH] Fix uninitialized memory and logic error in PaintRedirector The refactoring of Compositor starting with b1739c3 caused some regressions due to variables in Workspace and Compositor not being initialized. Furthermore there was a boolean logic error in PaintRedirector causing the decorations not to paint. BUG: 305875 --- composite.cpp | 7 +++++++ paintredirector.cpp | 2 +- workspace.cpp | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/composite.cpp b/composite.cpp index 4837d8a9c0..640ebd6a3c 100644 --- a/composite.cpp +++ b/composite.cpp @@ -87,7 +87,14 @@ Compositor::Compositor(QObject* workspace) : QObject(workspace) , m_suspended(!options->isUseCompositing()) , m_blocked(false) + , cm_selection(NULL) + , vBlankInterval(0) + , fpsInterval(0) , m_xrrRefreshRate(0) + , forceUnredirectCheck(false) + , m_finishing(false) + , m_timeSinceLastVBlank(0) + , m_nextFrameDelay(0) , m_scene(NULL) { connect(&unredirectTimer, SIGNAL(timeout()), SLOT(delayedCheckUnredirect())); diff --git a/paintredirector.cpp b/paintredirector.cpp index 7bc4bafb6c..55b20c4f4e 100644 --- a/paintredirector.cpp +++ b/paintredirector.cpp @@ -82,7 +82,7 @@ bool PaintRedirector::eventFilter(QObject* o, QEvent* e) break; } case QEvent::Paint: { - if (Workspace::self()->compositingActive()) { + if (!Workspace::self()->compositingActive()) { return false; } if (!recursionCheck) { diff --git a/workspace.cpp b/workspace.cpp index c6afa93bc4..e03e5e765b 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -105,6 +105,7 @@ Workspace::Workspace(bool restore) #ifdef KWIN_BUILD_SCREENEDGES , m_screenEdgeOrientation(0) #endif + , m_compositor(NULL) // Unsorted , active_popup(NULL) , active_popup_client(NULL) @@ -482,6 +483,7 @@ void Workspace::init() Workspace::~Workspace() { delete m_compositor; + m_compositor = NULL; blockStackingUpdates(true); // TODO: grabXServer();