From b9ce4b2954465742f9dd6df11552fa33f4df16c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sun, 29 Apr 2007 22:37:19 +0000 Subject: [PATCH] Merging from old trunk: r603295 | lunakl | 2006-11-08 14:59:27 +0100 (Wed, 08 Nov 2006) | 6 lines Ok, with a compositing manager running, VisibilityNotify no longer considers windows not visible just because a window is above them, so the code from r198017 no longer works. (#128648) svn path=/trunk/KDE/kdebase/workspace/; revision=659308 --- client.cpp | 1 - client.h | 2 -- events.cpp | 25 +++---------------------- layers.cpp | 2 ++ 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/client.cpp b/client.cpp index 44b4a4462b..57241afe18 100644 --- a/client.cpp +++ b/client.cpp @@ -125,7 +125,6 @@ Client::Client( Workspace *ws ) modal = false; noborder = false; user_noborder = false; - not_obscured = false; urgency = false; ignore_focus_stealing = false; demands_attention = false; diff --git a/client.h b/client.h index 9d4b07bf89..1097efb26c 100644 --- a/client.h +++ b/client.h @@ -287,7 +287,6 @@ class Client void clientMessageEvent( XClientMessageEvent* e ); void enterNotifyEvent( XCrossingEvent* e ); void leaveNotifyEvent( XCrossingEvent* e ); - void visibilityNotifyEvent( XVisibilityEvent* e ); void focusInEvent( XFocusInEvent* e ); void focusOutEvent( XFocusOutEvent* e ); @@ -423,7 +422,6 @@ class Client uint modal : 1; // NET::Modal uint noborder : 1; uint user_noborder : 1; - uint not_obscured : 1; uint urgency : 1; // XWMHints, UrgencyHint uint ignore_focus_stealing : 1; // don't apply focus stealing prevention to this client uint demands_attention : 1; diff --git a/events.cpp b/events.cpp index fd1814f656..7a693fc549 100644 --- a/events.cpp +++ b/events.cpp @@ -704,9 +704,6 @@ bool Client::windowEvent( XEvent* e ) workspace()->updateColormap(); } break; - case VisibilityNotify: - visibilityNotifyEvent( &e->xvisibility ); - break; default: if( e->xany.window == window()) { @@ -1084,18 +1081,13 @@ void Client::ungrabButton( int modifier ) */ void Client::updateMouseGrab() { - if( workspace()->globalShortcutsDisabled()) - { - XUngrabButton( display(), AnyButton, AnyModifier, wrapperId()); - // keep grab for the simple click without modifiers if needed - if( !( !options->clickRaise || not_obscured )) - grabButton( None ); - return; - } if( isActive() && !workspace()->forcedGlobalMouseGrab()) // see Workspace::establishTabBoxGrab() { // remove the grab for no modifiers only if the window // is unobscured or if the user doesn't want click raise + // (it is unobscured if it the topmost in the unconstrained stacking order, i.e. it is + // the most recently raised window) + bool not_obscured = workspace()->topClientOnDesktop( workspace()->currentDesktop(), true ) == this; if( !options->clickRaise || not_obscured ) ungrabButton( None ); else @@ -1508,17 +1500,6 @@ void Client::focusOutEvent( XFocusOutEvent* e ) setActive( false ); } -void Client::visibilityNotifyEvent( XVisibilityEvent * e) - { - if( e->window != frameId()) - return; // care only about the whole frame - bool new_not_obscured = e->state == VisibilityUnobscured; - if( not_obscured == new_not_obscured ) - return; - not_obscured = new_not_obscured; - updateMouseGrab(); - } - // performs _NET_WM_MOVERESIZE void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction ) { diff --git a/layers.cpp b/layers.cpp index d66157b1f4..e7b25c30fc 100644 --- a/layers.cpp +++ b/layers.cpp @@ -120,6 +120,8 @@ void Workspace::updateStackingOrder( bool propagate_new_clients ) { propagateClients( propagate_new_clients ); addRepaintFull(); + if( active_client ) + active_client->updateMouseGrab(); } }