From c8088bb731cfd8fdcf89069ae7e83bdd063d09e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 11 May 2005 14:46:23 +0000 Subject: [PATCH] When releasing a client, don't accidentally show it again. svn path=/trunk/KDE/kdebase/kwin/; revision=412379 --- client.cpp | 11 ++++++++++- client.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client.cpp b/client.cpp index 022c08fc09..4f90004c1a 100644 --- a/client.cpp +++ b/client.cpp @@ -109,6 +109,7 @@ Client::Client( Workspace *ws ) shade_mode = ShadeNone; active = FALSE; + deleting = false; keep_above = FALSE; keep_below = FALSE; is_shape = FALSE; @@ -155,6 +156,7 @@ Client::Client( Workspace *ws ) */ Client::~Client() { + assert( deleting ); assert(!moveResizeMode); assert( client == None ); assert( frame == None && wrapper == None ); @@ -176,6 +178,8 @@ void Client::deleteClient( Client* c, allowed_t ) */ void Client::releaseWindow( bool on_shutdown ) { + assert( !deleting ); + deleting = true; StackingUpdatesBlocker blocker( workspace()); if (!custom_opacity) setOpacity(FALSE); if (moveResizeMode) @@ -228,6 +232,8 @@ void Client::releaseWindow( bool on_shutdown ) // (e.g. the application closed it) void Client::destroyClient() { + assert( !deleting ); + deleting = true; StackingUpdatesBlocker blocker( workspace()); if (moveResizeMode) leaveMoveResize(); @@ -804,7 +810,7 @@ void Client::setShade( ShadeMode mode ) setGeometry( geometry(), ForceGeometrySet ); info->setState( isShade() ? NET::Shaded : 0, NET::Shaded ); info->setState( isShown( false ) ? 0 : NET::Hidden, NET::Hidden ); - setMappingState( isShown( false ) && isOnCurrentDesktop() ? NormalState : IconicState ); + updateVisibility(); updateAllowedActions(); workspace()->updateMinimizedOfTransients( this ); decoration->shadeChange(); @@ -831,6 +837,8 @@ void Client::toggleShade() void Client::updateVisibility() { + if( deleting ) + return; bool show = true; if( hidden ) { @@ -875,6 +883,7 @@ void Client::updateVisibility() void Client::setMappingState(int s) { assert( client != None ); + assert( !deleting || s == WithdrawnState ); if( mapping_state == s ) return; bool was_unmanaged = ( mapping_state == WithdrawnState ); diff --git a/client.h b/client.h index 83bb37d2f3..d4f15d26a5 100644 --- a/client.h +++ b/client.h @@ -456,6 +456,7 @@ class Client : public QObject, public KDecorationDefines ClientList transients_list; // SELI make this ordered in stacking order? ShadeMode shade_mode; uint active :1; + uint deleting : 1; // true when doing cleanup and destroying the client uint keep_above : 1; // NET::KeepAbove (was stays_on_top) uint is_shape :1; uint skip_taskbar :1;