From f5f0024b74d1bb0eb94937f3dc175d2b682617c2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 9 Sep 2011 02:03:42 +0000 Subject: Add new _KDE_WM_MODAL_SYS_NOTIFICATION atom to disable menu/close/on-all-desktops buttons Improve the appearance of the TDE logout sequence using the new atom git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1252231 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kwin/client.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'kwin/client.cpp') diff --git a/kwin/client.cpp b/kwin/client.cpp index 3205b9ec7..114300821 100644 --- a/kwin/client.cpp +++ b/kwin/client.cpp @@ -499,6 +499,20 @@ void Client::setUserNoBorder( bool set ) updateWindowRules(); } +bool Client::isModalSystemNotification() const + { + unsigned char *data = 0; + Atom actual; + int format, result; + unsigned long n, left; + result = XGetWindowProperty(qt_xdisplay(), window(), atoms->net_wm_system_modal_notification, 0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, /*(unsigned char **)*/ &data); + if (result == Success && data != None && format == 32 ) + { + return TRUE; + } + return FALSE; + } + void Client::updateShape() { // workaround for #19644 - tqshaped windows shouldn't have decoration @@ -603,6 +617,8 @@ bool Client::isMinimizable() const { if( isSpecialWindow()) return false; + if( isModalSystemNotification()) + return false; if( isTransient()) { // #66868 - let other xmms windows be minimized when the mainwindow is minimized bool shown_mainwindow = false; @@ -799,6 +815,8 @@ void Client::setShade( ShadeMode mode ) { if( !isShadeable()) return; + if( isModalSystemNotification()) + return; mode = rules()->checkShade( mode ); if( shade_mode == mode ) return; @@ -1674,6 +1692,8 @@ void Client::sendClientMessage(Window w, Atom a, Atom protocol, long data1, long */ bool Client::isCloseable() const { + if( isModalSystemNotification()) + return false; return rules()->checkCloseable( motif_may_close && !isSpecialWindow()); } -- cgit v1.2.1