|
|
@ -19,16 +19,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
// $Id: qtraylabel.cpp,v 1.31 2005/06/21 10:04:36 cs19713 Exp $
|
|
|
|
// $Id: qtraylabel.cpp,v 1.31 2005/06/21 10:04:36 cs19713 Exp $
|
|
|
|
|
|
|
|
|
|
|
|
// Include all Qt includes before X
|
|
|
|
// Include all TQt includes before X
|
|
|
|
#include <qstring.h>
|
|
|
|
#include <tqstring.h>
|
|
|
|
#include <qevent.h>
|
|
|
|
#include <tqevent.h>
|
|
|
|
#include <qpoint.h>
|
|
|
|
#include <tqpoint.h>
|
|
|
|
#include <qtooltip.h>
|
|
|
|
#include <tqtooltip.h>
|
|
|
|
#include <qtimer.h>
|
|
|
|
#include <tqtimer.h>
|
|
|
|
#include <qimage.h>
|
|
|
|
#include <tqimage.h>
|
|
|
|
#include <qpixmap.h>
|
|
|
|
#include <tqpixmap.h>
|
|
|
|
#include <qfileinfo.h>
|
|
|
|
#include <tqfileinfo.h>
|
|
|
|
#include <qapplication.h>
|
|
|
|
#include <tqapplication.h>
|
|
|
|
#include "trace.h"
|
|
|
|
#include "trace.h"
|
|
|
|
#include "qtraylabel.h"
|
|
|
|
#include "qtraylabel.h"
|
|
|
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "util.h"
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
|
|
|
|
void QTrayLabel::initialize(void)
|
|
|
|
void TQTrayLabel::initialize(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mDocked = false;
|
|
|
|
mDocked = false;
|
|
|
|
mWithdrawn = true;
|
|
|
|
mWithdrawn = true;
|
|
|
@ -55,30 +55,30 @@ void QTrayLabel::initialize(void)
|
|
|
|
mDockWhenMinimized = true;
|
|
|
|
mDockWhenMinimized = true;
|
|
|
|
mDesktop = 666; // setDockedWindow would set it a saner value
|
|
|
|
mDesktop = 666; // setDockedWindow would set it a saner value
|
|
|
|
|
|
|
|
|
|
|
|
// Balloon's properties are set to match a Qt tool tip (see Qt source)
|
|
|
|
// Balloon's properties are set to match a TQt tool tip (see TQt source)
|
|
|
|
mBalloon = new QLabel(0, "balloon", WType_TopLevel | WStyle_StaysOnTop |
|
|
|
|
mBalloon = new TQLabel(0, "balloon", WType_TopLevel | WStyle_StaysOnTop |
|
|
|
|
WStyle_Customize | WStyle_NoBorder |
|
|
|
|
WStyle_Customize | WStyle_NoBorder |
|
|
|
|
WStyle_Tool | WX11BypassWM);
|
|
|
|
WStyle_Tool | WX11BypassWM);
|
|
|
|
mBalloon->setFont(QToolTip::font());
|
|
|
|
mBalloon->setFont(TQToolTip::font());
|
|
|
|
mBalloon->setPalette(QToolTip::palette());
|
|
|
|
mBalloon->setPalette(TQToolTip::palette());
|
|
|
|
mBalloon->setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
|
|
|
mBalloon->setAlignment(TQt::AlignLeft | TQt::AlignTop);
|
|
|
|
mBalloon->setAutoMask(FALSE);
|
|
|
|
mBalloon->setAutoMask(FALSE);
|
|
|
|
mBalloon->setAutoResize(true);
|
|
|
|
mBalloon->setAutoResize(true);
|
|
|
|
setAlignment(Qt::AlignCenter);
|
|
|
|
setAlignment(TQt::AlignCenter);
|
|
|
|
setBackgroundMode(X11ParentRelative);
|
|
|
|
setBackgroundMode(X11ParentRelative);
|
|
|
|
|
|
|
|
|
|
|
|
connect(&mRealityMonitor, SIGNAL(timeout()), this, SLOT(realityCheck()));
|
|
|
|
connect(&mRealityMonitor, SIGNAL(timeout()), this, SLOT(realityCheck()));
|
|
|
|
setDockedWindow(mDockedWindow);
|
|
|
|
setDockedWindow(mDockedWindow);
|
|
|
|
|
|
|
|
|
|
|
|
sysTrayStatus(QPaintDevice::x11AppDisplay(), &mSysTray);
|
|
|
|
sysTrayStatus(TQPaintDevice::x11AppDisplay(), &mSysTray);
|
|
|
|
// Subscribe to system tray window notifications
|
|
|
|
// Subscribe to system tray window notifications
|
|
|
|
if (mSysTray != None)
|
|
|
|
if (mSysTray != None)
|
|
|
|
subscribe(QPaintDevice::x11AppDisplay(), mSysTray,
|
|
|
|
subscribe(TQPaintDevice::x11AppDisplay(), mSysTray,
|
|
|
|
StructureNotifyMask, true);
|
|
|
|
StructureNotifyMask, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Describe ourselves in a few words
|
|
|
|
// Describe ourselves in a few words
|
|
|
|
const char *QTrayLabel::me(void) const
|
|
|
|
const char *TQTrayLabel::me(void) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static char temp[100];
|
|
|
|
static char temp[100];
|
|
|
|
snprintf(temp, sizeof(temp), "(%s,PID=%i,WID=0x%x)",
|
|
|
|
snprintf(temp, sizeof(temp), "(%s,PID=%i,WID=0x%x)",
|
|
|
@ -86,23 +86,23 @@ const char *QTrayLabel::me(void) const
|
|
|
|
return temp;
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTrayLabel::QTrayLabel(Window w, QWidget* parent, const QString& text)
|
|
|
|
TQTrayLabel::TQTrayLabel(Window w, TQWidget* parent, const TQString& text)
|
|
|
|
:QLabel(parent, text.utf8(), WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
|
|
|
|
:TQLabel(parent, text.utf8(), WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
|
|
|
|
mDockedWindow(w), mPid(0)
|
|
|
|
mDockedWindow(w), mPid(0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
initialize();
|
|
|
|
initialize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTrayLabel::QTrayLabel(const QStringList& pname, pid_t pid, QWidget* parent)
|
|
|
|
TQTrayLabel::TQTrayLabel(const TQStringList& pname, pid_t pid, TQWidget* parent)
|
|
|
|
:QLabel(parent, "TrayLabel", WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
|
|
|
|
:TQLabel(parent, "TrayLabel", WStyle_Customize | WStyle_NoBorder | WStyle_Tool),
|
|
|
|
mDockedWindow(None), mProgName(pname), mPid(pid)
|
|
|
|
mDockedWindow(None), mProgName(pname), mPid(pid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (pname[0].at(0) != '/' && pname[0].find('/', 1) > 0)
|
|
|
|
if (pname[0].at(0) != '/' && pname[0].find('/', 1) > 0)
|
|
|
|
mProgName[0] = QFileInfo(pname[0]).absFilePath(); // convert to absolute
|
|
|
|
mProgName[0] = TQFileInfo(pname[0]).absFilePath(); // convert to absolute
|
|
|
|
initialize();
|
|
|
|
initialize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTrayLabel::~QTrayLabel()
|
|
|
|
TQTrayLabel::~TQTrayLabel()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s Goodbye", me());
|
|
|
|
TRACE("%s Goodbye", me());
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
@ -116,14 +116,14 @@ QTrayLabel::~QTrayLabel()
|
|
|
|
* Scans the windows in the desktop and checks if a window exists that we might
|
|
|
|
* Scans the windows in the desktop and checks if a window exists that we might
|
|
|
|
* be interested in
|
|
|
|
* be interested in
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::scanClients()
|
|
|
|
void TQTrayLabel::scanClients()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Window r, parent, *children;
|
|
|
|
Window r, parent, *children;
|
|
|
|
unsigned nchildren = 0;
|
|
|
|
unsigned nchildren = 0;
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
QString ename = QFileInfo(mProgName[0]).fileName(); // strip out the path
|
|
|
|
TQString ename = TQFileInfo(mProgName[0]).fileName(); // strip out the path
|
|
|
|
|
|
|
|
|
|
|
|
XQueryTree(display, qt_xrootwin(), &r, &parent, &children, &nchildren);
|
|
|
|
XQueryTree(display, tqt_xrootwin(), &r, &parent, &children, &nchildren);
|
|
|
|
TRACE("%s nchildren=%i", me(), nchildren);
|
|
|
|
TRACE("%s nchildren=%i", me(), nchildren);
|
|
|
|
for(unsigned i=0; i<nchildren; i++)
|
|
|
|
for(unsigned i=0; i<nchildren; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -143,38 +143,38 @@ void QTrayLabel::scanClients()
|
|
|
|
* Do a reality check :). Note that this timer runs only when required. Does 3
|
|
|
|
* Do a reality check :). Note that this timer runs only when required. Does 3
|
|
|
|
* things,
|
|
|
|
* things,
|
|
|
|
* 1) If the system tray had disappeared, checks for arrival of new system tray
|
|
|
|
* 1) If the system tray had disappeared, checks for arrival of new system tray
|
|
|
|
* 2) Check root window subscription since it is overwritten by Qt (see below)
|
|
|
|
* 2) Check root window subscription since it is overwritten by TQt (see below)
|
|
|
|
* 3) Checks health of the process whose windows we are docking
|
|
|
|
* 3) Checks health of the process whose windows we are docking
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::realityCheck(void)
|
|
|
|
void TQTrayLabel::realityCheck(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mSysTray == None)
|
|
|
|
if (mSysTray == None)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Check the system tray status if we were docked
|
|
|
|
// Check the system tray status if we were docked
|
|
|
|
if (sysTrayStatus(QPaintDevice::x11AppDisplay(), &mSysTray)
|
|
|
|
if (sysTrayStatus(TQPaintDevice::x11AppDisplay(), &mSysTray)
|
|
|
|
!= SysTrayPresent) return; // no luck
|
|
|
|
!= SysTrayPresent) return; // no luck
|
|
|
|
|
|
|
|
|
|
|
|
TRACE("%s System tray present", me());
|
|
|
|
TRACE("%s System tray present", me());
|
|
|
|
dock();
|
|
|
|
dock();
|
|
|
|
subscribe(QPaintDevice::x11AppDisplay(), mSysTray,
|
|
|
|
subscribe(TQPaintDevice::x11AppDisplay(), mSysTray,
|
|
|
|
StructureNotifyMask, true);
|
|
|
|
StructureNotifyMask, true);
|
|
|
|
mRealityMonitor.stop();
|
|
|
|
mRealityMonitor.stop();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* I am not sure when, but Qt at some point in time overwrites our
|
|
|
|
* I am not sure when, but TQt at some point in time overwrites our
|
|
|
|
* subscription (SubstructureNotifyMask) on the root window. So, we check
|
|
|
|
* subscription (SubstructureNotifyMask) on the root window. So, we check
|
|
|
|
* the status of root window subscription periodically. Now, from the time
|
|
|
|
* the status of root window subscription periodically. Now, from the time
|
|
|
|
* Qt overwrote our subscription to the time we discovered it, the
|
|
|
|
* TQt overwrote our subscription to the time we discovered it, the
|
|
|
|
* window we are looking for could have been mapped and we would have never
|
|
|
|
* window we are looking for could have been mapped and we would have never
|
|
|
|
* been informed (since Qt overrwrote the subscription). So we have to
|
|
|
|
* been informed (since TQt overrwrote the subscription). So we have to
|
|
|
|
* scan existing client list and dock. I have never seen this happen
|
|
|
|
* scan existing client list and dock. I have never seen this happen
|
|
|
|
* but I see it likely to happen during session restoration
|
|
|
|
* but I see it likely to happen during session restoration
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
XWindowAttributes attr;
|
|
|
|
XWindowAttributes attr;
|
|
|
|
XGetWindowAttributes(display, qt_xrootwin(), &attr);
|
|
|
|
XGetWindowAttributes(display, tqt_xrootwin(), &attr);
|
|
|
|
|
|
|
|
|
|
|
|
if (!(attr.your_event_mask & SubstructureNotifyMask))
|
|
|
|
if (!(attr.your_event_mask & SubstructureNotifyMask))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -197,12 +197,12 @@ void QTrayLabel::realityCheck(void)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Sends a message to the WM to show this window on all the desktops
|
|
|
|
* Sends a message to the WM to show this window on all the desktops
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::showOnAllDesktops(void)
|
|
|
|
void TQTrayLabel::showOnAllDesktops(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("Showing on all desktops");
|
|
|
|
TRACE("Showing on all desktops");
|
|
|
|
Display *d = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *d = TQPaintDevice::x11AppDisplay();
|
|
|
|
long l[5] = { -1, 0, 0, 0, 0 }; // -1 = all, 0 = Desktop1, 1 = Desktop2 ...
|
|
|
|
long l[5] = { -1, 0, 0, 0, 0 }; // -1 = all, 0 = Desktop1, 1 = Desktop2 ...
|
|
|
|
sendMessage(d, qt_xrootwin(), mDockedWindow, "_NET_WM_DESKTOP", 32,
|
|
|
|
sendMessage(d, tqt_xrootwin(), mDockedWindow, "_NET_WM_DESKTOP", 32,
|
|
|
|
SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
|
|
|
|
SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -218,7 +218,7 @@ const long SYSTEM_TRAY_CANCEL_MESSAGE = 2;
|
|
|
|
* 2. KDE 3.x and above - _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR
|
|
|
|
* 2. KDE 3.x and above - _KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR
|
|
|
|
* 3. Older KDE - KWM_DOCKWINDOW (Untested)
|
|
|
|
* 3. Older KDE - KWM_DOCKWINDOW (Untested)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::dock(void)
|
|
|
|
void TQTrayLabel::dock(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
mDocked = true;
|
|
|
|
mDocked = true;
|
|
|
@ -231,7 +231,7 @@ void QTrayLabel::dock(void)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
Window wid = winId();
|
|
|
|
Window wid = winId();
|
|
|
|
|
|
|
|
|
|
|
|
// 1. GNOME and NET WM Specification
|
|
|
|
// 1. GNOME and NET WM Specification
|
|
|
@ -264,7 +264,7 @@ void QTrayLabel::dock(void)
|
|
|
|
* working with with a delay of as little as 50ms. But since I
|
|
|
|
* working with with a delay of as little as 50ms. But since I
|
|
|
|
* dont understand why this delay is required, I am justifiably paranoid
|
|
|
|
* dont understand why this delay is required, I am justifiably paranoid
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
QTimer::singleShot(500, this, SLOT(show()));
|
|
|
|
TQTimer::singleShot(500, this, SLOT(show()));
|
|
|
|
|
|
|
|
|
|
|
|
// let the world know
|
|
|
|
// let the world know
|
|
|
|
emit docked(this);
|
|
|
|
emit docked(this);
|
|
|
@ -277,11 +277,11 @@ void QTrayLabel::dock(void)
|
|
|
|
* be used. It works but the system tray does not fill the void that we left
|
|
|
|
* be used. It works but the system tray does not fill the void that we left
|
|
|
|
* in the tray. Looks like the system tray will resize only for DestroyEvents
|
|
|
|
* in the tray. Looks like the system tray will resize only for DestroyEvents
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::undock(void)
|
|
|
|
void TQTrayLabel::undock(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s stopping reality monitor", me());
|
|
|
|
TRACE("%s stopping reality monitor", me());
|
|
|
|
mRealityMonitor.stop();
|
|
|
|
mRealityMonitor.stop();
|
|
|
|
XUnmapWindow(QPaintDevice::x11AppDisplay(), winId());
|
|
|
|
XUnmapWindow(TQPaintDevice::x11AppDisplay(), winId());
|
|
|
|
emit undocked(this);
|
|
|
|
emit undocked(this);
|
|
|
|
emit undocked();
|
|
|
|
emit undocked();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -289,13 +289,13 @@ void QTrayLabel::undock(void)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Maps the window from the same place it was withdrawn from
|
|
|
|
* Maps the window from the same place it was withdrawn from
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::map(void)
|
|
|
|
void TQTrayLabel::map(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
mWithdrawn = false;
|
|
|
|
mWithdrawn = false;
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
|
|
|
|
|
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
|
|
|
|
|
|
|
|
if (mDesktop == -1)
|
|
|
|
if (mDesktop == -1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -306,7 +306,7 @@ void QTrayLabel::map(void)
|
|
|
|
* the WM 200ms to do that. We will override that value to -1 (all
|
|
|
|
* the WM 200ms to do that. We will override that value to -1 (all
|
|
|
|
* desktops) on showOnAllDesktops().
|
|
|
|
* desktops) on showOnAllDesktops().
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
QTimer::singleShot(200, this, SLOT(showOnAllDesktops()));
|
|
|
|
TQTimer::singleShot(200, this, SLOT(showOnAllDesktops()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
@ -328,22 +328,22 @@ void QTrayLabel::map(void)
|
|
|
|
XSetWMNormalHints(display, mDockedWindow, &mSizeHint);
|
|
|
|
XSetWMNormalHints(display, mDockedWindow, &mSizeHint);
|
|
|
|
// make it the active window
|
|
|
|
// make it the active window
|
|
|
|
long l[5] = { None, CurrentTime, None, 0, 0 };
|
|
|
|
long l[5] = { None, CurrentTime, None, 0, 0 };
|
|
|
|
sendMessage(display, qt_xrootwin(), mDockedWindow, "_NET_ACTIVE_WINDOW", 32,
|
|
|
|
sendMessage(display, tqt_xrootwin(), mDockedWindow, "_NET_ACTIVE_WINDOW", 32,
|
|
|
|
SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
|
|
|
|
SubstructureNotifyMask | SubstructureRedirectMask, l, sizeof(l));
|
|
|
|
// skipTaskbar modifies _NET_WM_STATE. Make sure we dont override WMs value
|
|
|
|
// skipTaskbar modifies _NET_WM_STATE. Make sure we dont override WMs value
|
|
|
|
QTimer::singleShot(230, this, SLOT(skipTaskbar()));
|
|
|
|
TQTimer::singleShot(230, this, SLOT(skipTaskbar()));
|
|
|
|
// disable docking when minized for some time (since we went to Iconic state)
|
|
|
|
// disable docking when minized for some time (since we went to Iconic state)
|
|
|
|
mDockWhenMinimized = !mDockWhenMinimized;
|
|
|
|
mDockWhenMinimized = !mDockWhenMinimized;
|
|
|
|
QTimer::singleShot(230, this, SLOT(toggleDockWhenMinimized()));
|
|
|
|
TQTimer::singleShot(230, this, SLOT(toggleDockWhenMinimized()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTrayLabel::withdraw(void)
|
|
|
|
void TQTrayLabel::withdraw(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
mWithdrawn = true;
|
|
|
|
mWithdrawn = true;
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
|
|
|
|
|
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
int screen = DefaultScreen(display);
|
|
|
|
int screen = DefaultScreen(display);
|
|
|
|
long dummy;
|
|
|
|
long dummy;
|
|
|
|
|
|
|
|
|
|
|
@ -363,10 +363,10 @@ void QTrayLabel::withdraw(void)
|
|
|
|
memset(&ev, 0, sizeof(ev));
|
|
|
|
memset(&ev, 0, sizeof(ev));
|
|
|
|
ev.type = UnmapNotify;
|
|
|
|
ev.type = UnmapNotify;
|
|
|
|
ev.display = display;
|
|
|
|
ev.display = display;
|
|
|
|
ev.event = qt_xrootwin();
|
|
|
|
ev.event = tqt_xrootwin();
|
|
|
|
ev.window = mDockedWindow;
|
|
|
|
ev.window = mDockedWindow;
|
|
|
|
ev.from_configure = false;
|
|
|
|
ev.from_configure = false;
|
|
|
|
XSendEvent(display, qt_xrootwin(), False,
|
|
|
|
XSendEvent(display, tqt_xrootwin(), False,
|
|
|
|
SubstructureRedirectMask|SubstructureNotifyMask, (XEvent *)&ev);
|
|
|
|
SubstructureRedirectMask|SubstructureNotifyMask, (XEvent *)&ev);
|
|
|
|
XSync(display, False);
|
|
|
|
XSync(display, False);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -376,14 +376,14 @@ void QTrayLabel::withdraw(void)
|
|
|
|
* have _NET_WM_STATE_SKIP_TASKBAR. NET_WM_STATE needs to be updated
|
|
|
|
* have _NET_WM_STATE_SKIP_TASKBAR. NET_WM_STATE needs to be updated
|
|
|
|
* carefully since it is a set of states.
|
|
|
|
* carefully since it is a set of states.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::skipTaskbar(void)
|
|
|
|
void TQTrayLabel::skipTaskbar(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Atom __attribute__ ((unused)) type;
|
|
|
|
Atom __attribute__ ((unused)) type;
|
|
|
|
int __attribute__ ((unused)) format;
|
|
|
|
int __attribute__ ((unused)) format;
|
|
|
|
unsigned long __attribute__ ((unused)) left;
|
|
|
|
unsigned long __attribute__ ((unused)) left;
|
|
|
|
Atom *data = NULL;
|
|
|
|
Atom *data = NULL;
|
|
|
|
unsigned long nitems = 0, num_states = 0;
|
|
|
|
unsigned long nitems = 0, num_states = 0;
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
|
|
|
|
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", True);
|
|
|
|
Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", True);
|
|
|
@ -428,7 +428,7 @@ void QTrayLabel::skipTaskbar(void)
|
|
|
|
PropModeReplace, (unsigned char *) &old_states, nitems - 1);
|
|
|
|
PropModeReplace, (unsigned char *) &old_states, nitems - 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTrayLabel::setSkipTaskbar(bool skip)
|
|
|
|
void TQTrayLabel::setSkipTaskbar(bool skip)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s Skip=%i", me(), skip);
|
|
|
|
TRACE("%s Skip=%i", me(), skip);
|
|
|
|
mSkippingTaskbar = skip;
|
|
|
|
mSkippingTaskbar = skip;
|
|
|
@ -439,13 +439,13 @@ void QTrayLabel::setSkipTaskbar(bool skip)
|
|
|
|
* Closes a window by sending _NET_CLOSE_WINDOW. For reasons best unknown we
|
|
|
|
* Closes a window by sending _NET_CLOSE_WINDOW. For reasons best unknown we
|
|
|
|
* need to first map and then send the request.
|
|
|
|
* need to first map and then send the request.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::close(void)
|
|
|
|
void TQTrayLabel::close(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
long l[5] = { 0, 0, 0, 0, 0 };
|
|
|
|
long l[5] = { 0, 0, 0, 0, 0 };
|
|
|
|
map();
|
|
|
|
map();
|
|
|
|
sendMessage(display, qt_xrootwin(), mDockedWindow, "_NET_CLOSE_WINDOW", 32,
|
|
|
|
sendMessage(display, tqt_xrootwin(), mDockedWindow, "_NET_CLOSE_WINDOW", 32,
|
|
|
|
SubstructureNotifyMask | SubstructureRedirectMask,
|
|
|
|
SubstructureNotifyMask | SubstructureRedirectMask,
|
|
|
|
l, sizeof(l));
|
|
|
|
l, sizeof(l));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -453,10 +453,10 @@ void QTrayLabel::close(void)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Sets the tray icon. If the icon failed to load, we revert to application icon
|
|
|
|
* Sets the tray icon. If the icon failed to load, we revert to application icon
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::setTrayIcon(const QString& icon)
|
|
|
|
void TQTrayLabel::setTrayIcon(const TQString& icon)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mCustomIcon = icon;
|
|
|
|
mCustomIcon = icon;
|
|
|
|
if (QPixmap(mCustomIcon).isNull()) mCustomIcon = QString::null;
|
|
|
|
if (TQPixmap(mCustomIcon).isNull()) mCustomIcon = TQString::null;
|
|
|
|
TRACE("%s mCustomIcon=%s", me(), mCustomIcon.latin1());
|
|
|
|
TRACE("%s mCustomIcon=%s", me(), mCustomIcon.latin1());
|
|
|
|
updateIcon();
|
|
|
|
updateIcon();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -467,7 +467,7 @@ void QTrayLabel::setTrayIcon(const QString& icon)
|
|
|
|
* B) Subscribe/Unsubscribe for root/w notifications as appropriate
|
|
|
|
* B) Subscribe/Unsubscribe for root/w notifications as appropriate
|
|
|
|
* C) And of course, dock the window and apply some settings
|
|
|
|
* C) And of course, dock the window and apply some settings
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::setDockedWindow(Window w)
|
|
|
|
void TQTrayLabel::setDockedWindow(Window w)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s %s reality monitor", me(),
|
|
|
|
TRACE("%s %s reality monitor", me(),
|
|
|
|
mDockedWindow==None ? "Starting" : "Stopping");
|
|
|
|
mDockedWindow==None ? "Starting" : "Stopping");
|
|
|
@ -479,7 +479,7 @@ void QTrayLabel::setDockedWindow(Window w)
|
|
|
|
if (mDockedWindow == None) mRealityMonitor.start(500);
|
|
|
|
if (mDockedWindow == None) mRealityMonitor.start(500);
|
|
|
|
else mRealityMonitor.stop();
|
|
|
|
else mRealityMonitor.stop();
|
|
|
|
|
|
|
|
|
|
|
|
Display *d = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *d = TQPaintDevice::x11AppDisplay();
|
|
|
|
|
|
|
|
|
|
|
|
// Subscribe for window or root window events
|
|
|
|
// Subscribe for window or root window events
|
|
|
|
if (w == None) subscribe(d, None, SubstructureNotifyMask, true);
|
|
|
|
if (w == None) subscribe(d, None, SubstructureNotifyMask, true);
|
|
|
@ -503,7 +503,7 @@ void QTrayLabel::setDockedWindow(Window w)
|
|
|
|
|
|
|
|
|
|
|
|
if (mWithdrawn)
|
|
|
|
if (mWithdrawn)
|
|
|
|
// show the window for sometime before docking
|
|
|
|
// show the window for sometime before docking
|
|
|
|
QTimer::singleShot(1000, this, SLOT(withdraw()));
|
|
|
|
TQTimer::singleShot(1000, this, SLOT(withdraw()));
|
|
|
|
else map();
|
|
|
|
else map();
|
|
|
|
dock();
|
|
|
|
dock();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -512,12 +512,12 @@ void QTrayLabel::setDockedWindow(Window w)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Balloon text. Overload this if you dont like the way things are ballooned
|
|
|
|
* Balloon text. Overload this if you dont like the way things are ballooned
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::balloonText()
|
|
|
|
void TQTrayLabel::balloonText()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s BalloonText=%s ToolTipText=%s", me(),
|
|
|
|
TRACE("%s BalloonText=%s ToolTipText=%s", me(),
|
|
|
|
mBalloon->text().latin1(), QToolTip::textFor(this).latin1());
|
|
|
|
mBalloon->text().latin1(), TQToolTip::textFor(this).latin1());
|
|
|
|
|
|
|
|
|
|
|
|
if (mBalloon->text() == QToolTip::textFor(this)) return;
|
|
|
|
if (mBalloon->text() == TQToolTip::textFor(this)) return;
|
|
|
|
#if 0 // I_GOT_NETWM_BALLOONING_TO_WORK
|
|
|
|
#if 0 // I_GOT_NETWM_BALLOONING_TO_WORK
|
|
|
|
// if you can get NET WM ballooning to work let me know
|
|
|
|
// if you can get NET WM ballooning to work let me know
|
|
|
|
static int id = 1;
|
|
|
|
static int id = 1;
|
|
|
@ -538,28 +538,28 @@ void QTrayLabel::balloonText()
|
|
|
|
data += 20;
|
|
|
|
data += 20;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
// Manually do ballooning. See the Qt ToolTip code
|
|
|
|
// Manually do ballooning. See the TQt ToolTip code
|
|
|
|
QString oldText = mBalloon->text();
|
|
|
|
TQString oldText = mBalloon->text();
|
|
|
|
mBalloon->setText(QToolTip::textFor(this));
|
|
|
|
mBalloon->setText(TQToolTip::textFor(this));
|
|
|
|
if (oldText.isEmpty()) return; // dont tool tip the first time
|
|
|
|
if (oldText.isEmpty()) return; // dont tool tip the first time
|
|
|
|
QPoint p = mapToGlobal(QPoint(0, -1 - mBalloon->height()));
|
|
|
|
TQPoint p = mapToGlobal(TQPoint(0, -1 - mBalloon->height()));
|
|
|
|
if (p.x() + mBalloon->width() > QApplication::desktop()->width())
|
|
|
|
if (p.x() + mBalloon->width() > TQApplication::desktop()->width())
|
|
|
|
p.setX(p.x() + width() - mBalloon->width());
|
|
|
|
p.setX(p.x() + width() - mBalloon->width());
|
|
|
|
|
|
|
|
|
|
|
|
if (p.y() < 0) p.setY(height() + 1);
|
|
|
|
if (p.y() < 0) p.setY(height() + 1);
|
|
|
|
|
|
|
|
|
|
|
|
mBalloon->move(p);
|
|
|
|
mBalloon->move(p);
|
|
|
|
mBalloon->show();
|
|
|
|
mBalloon->show();
|
|
|
|
QTimer::singleShot(mBalloonTimeout, mBalloon, SLOT(hide()));
|
|
|
|
TQTimer::singleShot(mBalloonTimeout, mBalloon, SLOT(hide()));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Update the title in the menu. Balloon the title change if necessary
|
|
|
|
* Update the title in the menu. Balloon the title change if necessary
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::handleTitleChange(void)
|
|
|
|
void TQTrayLabel::handleTitleChange(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
char *window_name = NULL;
|
|
|
|
char *window_name = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
XFetchName(display, mDockedWindow, &window_name);
|
|
|
|
XFetchName(display, mDockedWindow, &window_name);
|
|
|
@ -570,8 +570,8 @@ void QTrayLabel::handleTitleChange(void)
|
|
|
|
XClassHint ch;
|
|
|
|
XClassHint ch;
|
|
|
|
if (XGetClassHint(display, mDockedWindow, &ch))
|
|
|
|
if (XGetClassHint(display, mDockedWindow, &ch))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (ch.res_class) mClass = QString(ch.res_class);
|
|
|
|
if (ch.res_class) mClass = TQString(ch.res_class);
|
|
|
|
else if (ch.res_name) mClass = QString(ch.res_name);
|
|
|
|
else if (ch.res_name) mClass = TQString(ch.res_name);
|
|
|
|
|
|
|
|
|
|
|
|
if (ch.res_class) XFree(ch.res_class);
|
|
|
|
if (ch.res_class) XFree(ch.res_class);
|
|
|
|
if (ch.res_name) XFree(ch.res_name);
|
|
|
|
if (ch.res_name) XFree(ch.res_name);
|
|
|
@ -585,24 +585,24 @@ void QTrayLabel::handleTitleChange(void)
|
|
|
|
* Overload this if you want a tool tip format that is different from the one
|
|
|
|
* Overload this if you want a tool tip format that is different from the one
|
|
|
|
* below i.e "Title [Class]".
|
|
|
|
* below i.e "Title [Class]".
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::updateTitle()
|
|
|
|
void TQTrayLabel::updateTitle()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
QString text = mTitle + " [" + mClass + "]";
|
|
|
|
TQString text = mTitle + " [" + mClass + "]";
|
|
|
|
QToolTip::remove(this);
|
|
|
|
TQToolTip::remove(this);
|
|
|
|
QToolTip::add(this, text);
|
|
|
|
TQToolTip::add(this, text);
|
|
|
|
|
|
|
|
|
|
|
|
if (mBalloonTimeout) balloonText();
|
|
|
|
if (mBalloonTimeout) balloonText();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTrayLabel::handleIconChange(void)
|
|
|
|
void TQTrayLabel::handleIconChange(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char **window_icon = NULL;
|
|
|
|
char **window_icon = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
|
if (mDockedWindow == None) return;
|
|
|
|
|
|
|
|
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
XWMHints *wm_hints = XGetWMHints(display, mDockedWindow);
|
|
|
|
XWMHints *wm_hints = XGetWMHints(display, mDockedWindow);
|
|
|
|
if (wm_hints != NULL)
|
|
|
|
if (wm_hints != NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -618,12 +618,12 @@ void QTrayLabel::handleIconChange(void)
|
|
|
|
wm_hints->icon_mask, NULL);
|
|
|
|
wm_hints->icon_mask, NULL);
|
|
|
|
XFree(wm_hints);
|
|
|
|
XFree(wm_hints);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QImage image;
|
|
|
|
TQImage image;
|
|
|
|
if (!window_icon)
|
|
|
|
if (!window_icon)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
image = KGlobal::iconLoader()->loadIcon("question", KIcon::NoGroup, KIcon::SizeMedium);
|
|
|
|
image = KGlobal::iconLoader()->loadIcon("question", KIcon::NoGroup, KIcon::SizeMedium);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else image = QPixmap((const char **) window_icon).convertToImage();
|
|
|
|
else image = TQPixmap((const char **) window_icon).convertToImage();
|
|
|
|
if (window_icon) XpmFree(window_icon);
|
|
|
|
if (window_icon) XpmFree(window_icon);
|
|
|
|
mAppIcon = image.smoothScale(24, 24); // why?
|
|
|
|
mAppIcon = image.smoothScale(24, 24); // why?
|
|
|
|
setMinimumSize(mAppIcon.size());
|
|
|
|
setMinimumSize(mAppIcon.size());
|
|
|
@ -635,19 +635,19 @@ void QTrayLabel::handleIconChange(void)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Overload this to possibly do operations on the pixmap before it is set
|
|
|
|
* Overload this to possibly do operations on the pixmap before it is set
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::updateIcon()
|
|
|
|
void TQTrayLabel::updateIcon()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s", me());
|
|
|
|
TRACE("%s", me());
|
|
|
|
setPixmap(mCustomIcon.isEmpty() ? mAppIcon : mCustomIcon);
|
|
|
|
setPixmap(mCustomIcon.isEmpty() ? mAppIcon : mCustomIcon);
|
|
|
|
erase();
|
|
|
|
erase();
|
|
|
|
QPaintEvent pe(rect());
|
|
|
|
TQPaintEvent pe(rect());
|
|
|
|
paintEvent(&pe);
|
|
|
|
paintEvent(&pe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Mouse activity on our label. RightClick = Menu. LeftClick = Toggle Map
|
|
|
|
* Mouse activity on our label. RightClick = Menu. LeftClick = Toggle Map
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::mouseReleaseEvent(QMouseEvent * ev)
|
|
|
|
void TQTrayLabel::mouseReleaseEvent(TQMouseEvent * ev)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
emit clicked(ev->button(), ev->globalPos());
|
|
|
|
emit clicked(ev->button(), ev->globalPos());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -655,7 +655,7 @@ void QTrayLabel::mouseReleaseEvent(QMouseEvent * ev)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Track drag event
|
|
|
|
* Track drag event
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void QTrayLabel::dragEnterEvent(QDragEnterEvent *ev)
|
|
|
|
void TQTrayLabel::dragEnterEvent(TQDragEnterEvent *ev)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ev->accept();
|
|
|
|
ev->accept();
|
|
|
|
map();
|
|
|
|
map();
|
|
|
@ -664,7 +664,7 @@ void QTrayLabel::dragEnterEvent(QDragEnterEvent *ev)
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Event dispatcher
|
|
|
|
* Event dispatcher
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
bool QTrayLabel::x11EventFilter(XEvent *ev)
|
|
|
|
bool TQTrayLabel::x11EventFilter(XEvent *ev)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XAnyEvent *event = (XAnyEvent *)ev;
|
|
|
|
XAnyEvent *event = (XAnyEvent *)ev;
|
|
|
|
|
|
|
|
|
|
|
@ -709,32 +709,32 @@ bool QTrayLabel::x11EventFilter(XEvent *ev)
|
|
|
|
|
|
|
|
|
|
|
|
TRACE("%s Will analyze window 0x%x", me(), (int)((XMapEvent *)event)->window);
|
|
|
|
TRACE("%s Will analyze window 0x%x", me(), (int)((XMapEvent *)event)->window);
|
|
|
|
// Check if this window is the soulmate we are looking for
|
|
|
|
// Check if this window is the soulmate we are looking for
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
Window w = XmuClientWindow(display, ((XMapEvent *) event)->window);
|
|
|
|
Window w = XmuClientWindow(display, ((XMapEvent *) event)->window);
|
|
|
|
if (!isNormalWindow(display, w)) return FALSE;
|
|
|
|
if (!isNormalWindow(display, w)) return FALSE;
|
|
|
|
if (!analyzeWindow(display, w, mPid,
|
|
|
|
if (!analyzeWindow(display, w, mPid,
|
|
|
|
QFileInfo(mProgName[0]).fileName().latin1())) return FALSE;
|
|
|
|
TQFileInfo(mProgName[0]).fileName().latin1())) return FALSE;
|
|
|
|
// All right. Lets dock this baby
|
|
|
|
// All right. Lets dock this baby
|
|
|
|
setDockedWindow(w);
|
|
|
|
setDockedWindow(w);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTrayLabel::minimizeEvent(void)
|
|
|
|
void TQTrayLabel::minimizeEvent(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("minimizeEvent");
|
|
|
|
TRACE("minimizeEvent");
|
|
|
|
if (mDockWhenMinimized) withdraw();
|
|
|
|
if (mDockWhenMinimized) withdraw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTrayLabel::destroyEvent(void)
|
|
|
|
void TQTrayLabel::destroyEvent(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s destroyEvent", me());
|
|
|
|
TRACE("%s destroyEvent", me());
|
|
|
|
setDockedWindow(None);
|
|
|
|
setDockedWindow(None);
|
|
|
|
if (!mPid) undock();
|
|
|
|
if (!mPid) undock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void QTrayLabel::propertyChangeEvent(Atom property)
|
|
|
|
void TQTrayLabel::propertyChangeEvent(Atom property)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Display *display = QPaintDevice::x11AppDisplay();
|
|
|
|
Display *display = TQPaintDevice::x11AppDisplay();
|
|
|
|
static Atom WM_NAME = XInternAtom(display, "WM_NAME", True);
|
|
|
|
static Atom WM_NAME = XInternAtom(display, "WM_NAME", True);
|
|
|
|
static Atom WM_ICON = XInternAtom(display, "WM_ICON", True);
|
|
|
|
static Atom WM_ICON = XInternAtom(display, "WM_ICON", True);
|
|
|
|
static Atom WM_STATE = XInternAtom(display, "WM_STATE", True);
|
|
|
|
static Atom WM_STATE = XInternAtom(display, "WM_STATE", True);
|
|
|
@ -771,7 +771,7 @@ void QTrayLabel::propertyChangeEvent(Atom property)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Session Management
|
|
|
|
// Session Management
|
|
|
|
bool QTrayLabel::saveState(QSettings &settings)
|
|
|
|
bool TQTrayLabel::saveState(TQSettings &settings)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s saving state", me());
|
|
|
|
TRACE("%s saving state", me());
|
|
|
|
settings.writeEntry("/Application", mProgName.join(" "));
|
|
|
|
settings.writeEntry("/Application", mProgName.join(" "));
|
|
|
@ -783,7 +783,7 @@ bool QTrayLabel::saveState(QSettings &settings)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool QTrayLabel::restoreState(QSettings &settings)
|
|
|
|
bool TQTrayLabel::restoreState(TQSettings &settings)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TRACE("%s restoring state", me());
|
|
|
|
TRACE("%s restoring state", me());
|
|
|
|
mCustomIcon = settings.readEntry("/CustomIcon");
|
|
|
|
mCustomIcon = settings.readEntry("/CustomIcon");
|
|
|
@ -802,7 +802,7 @@ bool QTrayLabel::restoreState(QSettings &settings)
|
|
|
|
* the application really shows itself up before we do a scan (the reason
|
|
|
|
* the application really shows itself up before we do a scan (the reason
|
|
|
|
* why we have 2s
|
|
|
|
* why we have 2s
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if (!mPid) QTimer::singleShot(2000, this, SLOT(scanClients()));
|
|
|
|
if (!mPid) TQTimer::singleShot(2000, this, SLOT(scanClients()));
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|