1 --- kdelibs-3.5.1/kdeui/ksystemtray.cpp 2005-10-10 11:06:38.000000000 -0400
2 +++ kdelibs-3.5.1-patched/kdeui/ksystemtray.cpp 2006-02-18 11:52:01.000000000 -0500
5 #include <kwinmodule.h>
10 #include <kiconloader.h>
13 #include <qapplication.h>
15 +extern Time qt_x_time;
17 class KSystemTrayPrivate
21 QXEmbed::initialize();
25 + XGrabServer (qt_xdisplay());
26 + static Atom selection = XInternAtom( qt_xdisplay(), "_NET_SYSTEM_TRAY_S" + QCString().setNum( qt_xscreen()), False );
28 + /* look for the system tray window */
29 + Window tray = XGetSelectionOwner (qt_xdisplay(), selection);
34 + XSelectInput (qt_xdisplay(), tray, StructureNotifyMask);
37 + XUngrabServer (qt_xdisplay());
38 + XFlush (qt_xdisplay());
43 + memset(&ev, 0, sizeof( ev ));
44 + static Atom atom = XInternAtom( qt_xdisplay(), "_NET_SYSTEM_TRAY_OPCODE", False );
45 + ev.xclient.type = ClientMessage;
46 + ev.xclient.window = tray;
47 + ev.xclient.message_type = atom;
48 + ev.xclient.format = 32;
49 + ev.xclient.data.l[ 0 ] = qt_x_time;
50 + ev.xclient.data.l[ 1 ] = 0; // SYSTEM_TRAY_REQUEST_DOCK
51 + ev.xclient.data.l[ 2 ] = winId();
52 + ev.xclient.data.l[ 3 ] = 0; // unused
53 + ev.xclient.data.l[ 4 ] = 0; // unused
55 + XSendEvent( qt_xdisplay(), tray, False, NoEventMask, (XEvent *)&ev );
56 + XSync(qt_xdisplay(), FALSE );
61 d = new KSystemTrayPrivate;
62 d->actionCollection = new KActionCollection(this);