]>
Commit | Line | Data |
---|---|---|
00296e78 | 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 | |
3 | @@ -32,6 +32,7 @@ | |
4 | #include <kwin.h> | |
5 | #include <kwinmodule.h> | |
6 | #include <qxembed.h> | |
7 | +#include <X11/Xlib.h> | |
8 | #endif | |
9 | ||
10 | #include <kiconloader.h> | |
11 | @@ -39,6 +40,8 @@ | |
12 | ||
13 | #include <qapplication.h> | |
14 | ||
15 | +extern Time qt_x_time; | |
16 | + | |
17 | class KSystemTrayPrivate | |
18 | { | |
19 | public: | |
20 | @@ -63,6 +66,43 @@ | |
21 | QXEmbed::initialize(); | |
22 | #endif | |
23 | ||
24 | + { | |
25 | + XGrabServer (qt_xdisplay()); | |
26 | + static Atom selection = XInternAtom( qt_xdisplay(), "_NET_SYSTEM_TRAY_S" + QCString().setNum( qt_xscreen()), False ); | |
27 | + | |
28 | + /* look for the system tray window */ | |
29 | + Window tray = XGetSelectionOwner (qt_xdisplay(), selection); | |
30 | + | |
31 | + if (tray != None) | |
32 | + { | |
33 | + /* found it */ | |
34 | + XSelectInput (qt_xdisplay(), tray, StructureNotifyMask); | |
35 | + } | |
36 | + | |
37 | + XUngrabServer (qt_xdisplay()); | |
38 | + XFlush (qt_xdisplay()); | |
39 | + | |
40 | + if ( tray != None ) | |
41 | + { | |
42 | + XEvent ev; | |
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 | |
54 | + | |
55 | + XSendEvent( qt_xdisplay(), tray, False, NoEventMask, (XEvent *)&ev ); | |
56 | + XSync(qt_xdisplay(), FALSE ); | |
57 | + } | |
58 | + } | |
59 | + | |
60 | + | |
61 | d = new KSystemTrayPrivate; | |
62 | d->actionCollection = new KActionCollection(this); | |
63 |