summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-19 14:19:10 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-19 14:19:10 +0000
commitcdb87c26910653e9a0201f9c01a2fb3cb0e6d0c9 (patch)
tree2592b3b0fe0aafc003eef042a97bb518abf72d2b /client
parent3069b320f9ba8b021d9deb99421429817801825f (diff)
downloadtwin-style-crystal-cdb87c26910653e9a0201f9c01a2fb3cb0e6d0c9.tar.gz
twin-style-crystal-cdb87c26910653e9a0201f9c01a2fb3cb0e6d0c9.zip
Fix crystal window decoration clientv3.5.13
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kwin-style-crystal@1254499 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'client')
-rw-r--r--client/crystalclient.cc47
-rw-r--r--client/crystalclient.h1
2 files changed, 36 insertions, 12 deletions
diff --git a/client/crystalclient.cc b/client/crystalclient.cc
index 8beedd7..2263b3c 100644
--- a/client/crystalclient.cc
+++ b/client/crystalclient.cc
@@ -41,6 +41,9 @@
#include "imageholder.h"
#include "overlays.h"
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+
// Button themes
#include "tiles.h"
@@ -854,6 +857,22 @@ void CrystalClient::updateMask()
setMask(mask);
}
+bool CrystalClient::isModalSystemNotification()
+{
+ unsigned char *data = 0;
+ Atom actual;
+ int format, result;
+ unsigned long n, left;
+ Atom kde_wm_system_modal_notification;
+ kde_wm_system_modal_notification = XInternAtom(qt_xdisplay(), "_KDE_WM_MODAL_SYS_NOTIFICATION", False);
+ result = XGetWindowProperty(qt_xdisplay(), windowId(), kde_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;
+}
+
CrystalButton* CrystalClient::addButtons(TQBoxLayout *tqlayout, const TQString& s)
{
ButtonImage *bitmap;
@@ -867,23 +886,27 @@ CrystalButton* CrystalClient::addButtons(TQBoxLayout *tqlayout, const TQString&
CrystalButton *current=NULL;
switch (s[n]) {
case 'M': // Menu button
- if (!button[ButtonMenu]) {
- button[ButtonMenu] = current = new CrystalButton(this, "menu", i18n("Menu"), ButtonMenu, ::factory->buttonImages[ButtonImageMenu]);
- connect(button[ButtonMenu], TQT_SIGNAL(pressed()), this, TQT_SLOT(menuButtonPressed()));
+ if (!isModalSystemNotification()) {
+ if (!button[ButtonMenu]) {
+ button[ButtonMenu] = current = new CrystalButton(this, "menu", i18n("Menu"), ButtonMenu, ::factory->buttonImages[ButtonImageMenu]);
+ connect(button[ButtonMenu], TQT_SIGNAL(pressed()), this, TQT_SLOT(menuButtonPressed()));
+ }
}
break;
case 'S': // Sticky button
- if (!button[ButtonSticky]) {
- if (isOnAllDesktops()) {
- bitmap = ::factory->buttonImages[ButtonImageSticky];
- tip = i18n("Not on all desktops");
- } else {
- bitmap = ::factory->buttonImages[ButtonImageUnSticky];
- tip = i18n("On All Desktops");
+ if (!isModalSystemNotification()) {
+ if (!button[ButtonSticky]) {
+ if (isOnAllDesktops()) {
+ bitmap = ::factory->buttonImages[ButtonImageSticky];
+ tip = i18n("Not on all desktops");
+ } else {
+ bitmap = ::factory->buttonImages[ButtonImageUnSticky];
+ tip = i18n("On All Desktops");
+ }
+ button[ButtonSticky] =current=new CrystalButton(this, "sticky", tip,ButtonSticky, bitmap);
+ connect(button[ButtonSticky], TQT_SIGNAL(clicked()),this, TQT_SLOT(toggleOnAllDesktops()));
}
- button[ButtonSticky] =current=new CrystalButton(this, "sticky", tip,ButtonSticky, bitmap);
- connect(button[ButtonSticky], TQT_SIGNAL(clicked()),this, TQT_SLOT(toggleOnAllDesktops()));
}
break;
diff --git a/client/crystalclient.h b/client/crystalclient.h
index cc5784e..672a743 100644
--- a/client/crystalclient.h
+++ b/client/crystalclient.h
@@ -170,6 +170,7 @@ private:
void updateMask();
int borderSpacing();
void updateLayout();
+ bool isModalSystemNotification();
bool eventFilter(TQObject *obj, TQEvent *e);
void mouseDoubleClickEvent(TQMouseEvent *e);