From d3e8f75adad69c20a879d63533e7eb8266d80449 Mon Sep 17 00:00:00 2001 From: Matthias Ettrich Date: Thu, 10 Aug 2000 13:01:12 +0000 Subject: [PATCH] no need for application-modal dialogs to stay on top.... svn path=/trunk/kdebase/kwin/; revision=60475 --- client.cpp | 16 +++++++++++----- client.h | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/client.cpp b/client.cpp index e32befa198..f2788796d9 100644 --- a/client.cpp +++ b/client.cpp @@ -417,6 +417,7 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags active = FALSE; shaded = FALSE; transient_for = None; + transient_for_defined = FALSE; is_shape = FALSE; is_sticky = FALSE; stays_on_top = FALSE; @@ -431,14 +432,16 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags Window ww; if ( !XGetTransientForHint( qt_xdisplay(), (Window) win, &ww ) ) transient_for = None; - else + else { transient_for = (WId) ww; + transient_for_defined = TRUE; + } if ( mainClient()->isSticky() ) setSticky( TRUE ); // window wants to stay on top? - stays_on_top = ( info->state() & NET::StaysOnTop) != 0 || transient_for == workspace()->rootWin(); + stays_on_top = ( info->state() & NET::StaysOnTop) != 0 || ( transient_for == None && transient_for_defined ); // window does not want a taskbar entry? skip_taskbar = ( info->state() & NET::SkipTaskbar) != 0; @@ -929,10 +932,13 @@ bool Client::propertyNotify( XPropertyEvent& e ) break; case XA_WM_TRANSIENT_FOR: Window ww; - if ( !XGetTransientForHint( qt_xdisplay(), (Window) win, &ww ) ) + if ( !XGetTransientForHint( qt_xdisplay(), (Window) win, &ww ) ) { transient_for = None; - else + transient_for_defined = FALSE; + } else { transient_for = (WId) ww; + transient_for_defined = TRUE; + } break; case XA_WM_HINTS: getWMHints(); @@ -1985,7 +1991,7 @@ void Client::setMask( const QRegion & reg) */ Client* Client::mainClient() { - if ( !isTransient() ) + if ( !isTransient() && transientFor() != 0 ) return this; ClientList saveset; Client* c = this; diff --git a/client.h b/client.h index f030aed929..1cf690e9eb 100644 --- a/client.h +++ b/client.h @@ -246,6 +246,7 @@ private: QRect original_geometry; QRect geom; //### TODO WId transient_for; + uint transient_for_defined; uint shaded :1; uint active :1; uint is_sticky :1; @@ -291,7 +292,7 @@ inline WId Client::transientFor() const inline bool Client::isTransient() const { - return transient_for != 0; + return transient_for != 0 || transient_for_defined; }