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