Fix crystal window decoration client

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kwin-style-crystal@1254499 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru v3.5.13
tpearson 13 years ago
parent 3069b320f9
commit cdb87c2691

@ -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;

@ -170,6 +170,7 @@ private:
void updateMask();
int borderSpacing();
void updateLayout();
bool isModalSystemNotification();
bool eventFilter(TQObject *obj, TQEvent *e);
void mouseDoubleClickEvent(TQMouseEvent *e);

Loading…
Cancel
Save