31#include <tqwindowdefs.h>
36#include <kxerrorhandler.h>
43static long getSimpleProperty(Window w, Atom a)
47 unsigned long n, extra, res = 0;
51 status = XGetWindowProperty(tqt_xdisplay(), w, a, 0L, 1L, False, a,
52 &real_type, &format, &n, &extra, &p);
53 if ((status == Success) && (n == 1) && (format == 32))
54 res = *(
unsigned long*)p;
65 a = XInternAtom(tqt_xdisplay(),
"KIPC_COMM_ATOM", False);
67 ev.xclient.type = ClientMessage;
68 ev.xclient.display = tqt_xdisplay();
69 ev.xclient.window = (Window) w;
70 ev.xclient.message_type = a;
71 ev.xclient.format = 32;
72 ev.xclient.data.l[0] = msg;
73 ev.xclient.data.l[1] = data;
74 XSendEvent(tqt_xdisplay(), (Window) w, False, 0L, &ev);
78 if ( msg == PaletteChanged || msg == FontChanged ) {
80 kde1 = XInternAtom(tqt_xdisplay(),
"KDEChangeGeneral", False );
81 ev.xclient.message_type = kde1;
82 XSendEvent(tqt_xdisplay(), (Window) w, False, 0L, &ev);
92 unsigned int i, nrootwins;
93 Window dw1, dw2, *rootwins = 0;
94 Display *dpy = tqt_xdisplay();
95 int screen_count = ScreenCount(dpy);
98 for (
int s = 0; s < screen_count; s++) {
99 Window root = RootWindow(dpy, s);
101 XQueryTree(dpy, root, &dw1, &dw2, &rootwins, &nrootwins);
102 Atom a = XInternAtom(tqt_xdisplay(),
"KDE_DESKTOP_WINDOW", False);
103 for (i = 0; i < nrootwins; i++)
105 if (getSimpleProperty(rootwins[i], a) != 0L)
108 XFree((
char *) rootwins);
static void sendMessage(Message msg, WId w, int data=0)
Send a message to a specific application.
static void sendMessageAll(Message msg, int data=0)
Send a message to all KDE application on the current display.
Message
A identifier for messages.
This class simplifies handling of X errors.