Show the composite overlay window only before the first painting pass
actually needs to flush the output to the screen. Avoids windows temporarily disappearing during KDE startup or similar visual glitches. svn path=/trunk/KDE/kdebase/workspace/; revision=806387
This commit is contained in:
parent
19c6ce9075
commit
53cc35b649
5 changed files with 18 additions and 4 deletions
|
@ -372,14 +372,20 @@ void Workspace::setupOverlay( Window w )
|
||||||
assert( Extensions::shapeInputAvailable());
|
assert( Extensions::shapeInputAvailable());
|
||||||
XShapeCombineRectangles( display(), overlay, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted );
|
XShapeCombineRectangles( display(), overlay, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted );
|
||||||
if( w != None )
|
if( w != None )
|
||||||
{
|
|
||||||
XShapeCombineRectangles( display(), w, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted );
|
XShapeCombineRectangles( display(), w, ShapeInput, 0, 0, NULL, 0, ShapeSet, Unsorted );
|
||||||
XMapWindow( display(), w );
|
|
||||||
}
|
|
||||||
XMapRaised( display(), overlay );
|
|
||||||
XSelectInput( display(), overlay, VisibilityChangeMask );
|
XSelectInput( display(), overlay, VisibilityChangeMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Workspace::showOverlay()
|
||||||
|
{
|
||||||
|
assert( overlay != None );
|
||||||
|
if( overlay_shown )
|
||||||
|
return;
|
||||||
|
XMapSubwindows( display(), overlay );
|
||||||
|
XMapWindow( display(), overlay );
|
||||||
|
overlay_shown = true;
|
||||||
|
}
|
||||||
|
|
||||||
void Workspace::destroyOverlay()
|
void Workspace::destroyOverlay()
|
||||||
{
|
{
|
||||||
if( overlay == None )
|
if( overlay == None )
|
||||||
|
@ -388,6 +394,7 @@ void Workspace::destroyOverlay()
|
||||||
XCompositeReleaseOverlayWindow( display(), overlay );
|
XCompositeReleaseOverlayWindow( display(), overlay );
|
||||||
#endif
|
#endif
|
||||||
overlay = None;
|
overlay = None;
|
||||||
|
overlay_shown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//****************************************
|
//****************************************
|
||||||
|
|
|
@ -638,6 +638,8 @@ void SceneOpenGL::waitSync()
|
||||||
// actually paint to the screen (double-buffer swap or copy from pixmap buffer)
|
// actually paint to the screen (double-buffer swap or copy from pixmap buffer)
|
||||||
void SceneOpenGL::flushBuffer( int mask, QRegion damage )
|
void SceneOpenGL::flushBuffer( int mask, QRegion damage )
|
||||||
{
|
{
|
||||||
|
if( wspace->overlayWindow()) // show the window only after the first pass, since
|
||||||
|
wspace->showOverlay(); // that pass may take long
|
||||||
if( db )
|
if( db )
|
||||||
{
|
{
|
||||||
if( mask & PAINT_SCREEN_REGION )
|
if( mask & PAINT_SCREEN_REGION )
|
||||||
|
|
|
@ -170,6 +170,8 @@ void SceneXrender::paint( QRegion damage, ToplevelList toplevels )
|
||||||
}
|
}
|
||||||
int mask = 0;
|
int mask = 0;
|
||||||
paintScreen( &mask, &damage );
|
paintScreen( &mask, &damage );
|
||||||
|
if( wspace->overlayWindow()) // show the window only after the first pass, since
|
||||||
|
wspace->showOverlay(); // that pass may take long
|
||||||
if( mask & PAINT_SCREEN_REGION )
|
if( mask & PAINT_SCREEN_REGION )
|
||||||
{
|
{
|
||||||
// Use the damage region as the clip region for the root window
|
// Use the damage region as the clip region for the root window
|
||||||
|
|
|
@ -137,6 +137,7 @@ Workspace::Workspace( bool restore )
|
||||||
compositeRate( 0 ),
|
compositeRate( 0 ),
|
||||||
overlay( None ),
|
overlay( None ),
|
||||||
overlay_visible( true ),
|
overlay_visible( true ),
|
||||||
|
overlay_shown( false ),
|
||||||
transSlider( NULL ),
|
transSlider( NULL ),
|
||||||
transButton( NULL )
|
transButton( NULL )
|
||||||
{
|
{
|
||||||
|
|
|
@ -318,6 +318,7 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
bool createOverlay();
|
bool createOverlay();
|
||||||
// init overlay and the destination window in it
|
// init overlay and the destination window in it
|
||||||
void setupOverlay( Window window );
|
void setupOverlay( Window window );
|
||||||
|
void showOverlay();
|
||||||
// destroys XComposite overlay window
|
// destroys XComposite overlay window
|
||||||
void destroyOverlay();
|
void destroyOverlay();
|
||||||
Window overlayWindow();
|
Window overlayWindow();
|
||||||
|
@ -723,6 +724,7 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
QRegion repaints_region;
|
QRegion repaints_region;
|
||||||
Window overlay; // XComposite overlay window
|
Window overlay; // XComposite overlay window
|
||||||
bool overlay_visible;
|
bool overlay_visible;
|
||||||
|
bool overlay_shown; // for showOverlay()
|
||||||
QSlider *transSlider;
|
QSlider *transSlider;
|
||||||
QPushButton *transButton;
|
QPushButton *transButton;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue