From cda447745819cfa5fadf7350ec6707447a47b5f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sun, 9 Mar 2008 20:06:11 +0000 Subject: [PATCH] Add a hack that somewhat improves screen repaint after X session switch with drivers that have a problem with this. CCBUG: 154825 svn path=/trunk/KDE/kdebase/workspace/; revision=783860 --- events.cpp | 7 ++++++- workspace.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/events.cpp b/events.cpp index 39d9d99739..f43fc4134d 100644 --- a/events.cpp +++ b/events.cpp @@ -477,8 +477,13 @@ bool Workspace::workspaceEvent( XEvent * e ) case VisibilityNotify: if( compositing() && overlay != None && e->xvisibility.window == overlay ) { + bool was_visible = overlay_visible; overlay_visible = ( e->xvisibility.state != VisibilityFullyObscured ); - addRepaintFull(); + if( !was_visible && overlay_visible ) + { // hack for #154825 + addRepaintFull(); + QTimer::singleShot( 2000, this, SLOT( addRepaintFull())); + } } break; default: diff --git a/workspace.h b/workspace.h index 0fa62776ff..6d7155ebca 100644 --- a/workspace.h +++ b/workspace.h @@ -314,7 +314,6 @@ class Workspace : public QObject, public KDecorationDefines // either Toplevel::addRepaint() or Toplevel::addWorkspaceRepaint() void addRepaint( const QRect& r ); void addRepaint( int x, int y, int w, int h ); - void addRepaintFull(); // creates XComposite overlay window, call initOverlay() afterwards bool createOverlay(); // init overlay and the destination window in it @@ -324,6 +323,7 @@ class Workspace : public QObject, public KDecorationDefines Window overlayWindow(); public slots: + void addRepaintFull(); void refresh(); // keybindings void slotSwitchDesktopNext();