1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

Tidy comms between external apps and wm a bit

- one instance of this left in setstyle, it will follow later
This commit is contained in:
Tamas TEVESZ
2010-04-01 03:26:30 +02:00
committed by Carlos R. Mafra
parent e7a46d5cdf
commit 81aaed2bf8
2 changed files with 17 additions and 5 deletions

View File

@@ -116,7 +116,6 @@ static void save(WMWidget * w, void *data)
WMPropList *p1, *p2; WMPropList *p1, *p2;
WMPropList *keyList; WMPropList *keyList;
WMPropList *key; WMPropList *key;
char *msg = "Reconfigure";
XEvent ev; XEvent ev;
/* puts("gathering data"); */ /* puts("gathering data"); */
@@ -157,10 +156,8 @@ static void save(WMWidget * w, void *data)
ev.xclient.message_type = XInternAtom(WMScreenDisplay(WMWidgetScreen(w)), "_WINDOWMAKER_COMMAND", False); ev.xclient.message_type = XInternAtom(WMScreenDisplay(WMWidgetScreen(w)), "_WINDOWMAKER_COMMAND", False);
ev.xclient.window = DefaultRootWindow(WMScreenDisplay(WMWidgetScreen(w))); ev.xclient.window = DefaultRootWindow(WMScreenDisplay(WMWidgetScreen(w)));
ev.xclient.format = 8; ev.xclient.format = 8;
strncpy(ev.xclient.data.b, "Reconfigure", sizeof(ev.xclient.data.b));
for (i = 0; i <= strlen(msg); i++) {
ev.xclient.data.b[i] = msg[i];
}
XSendEvent(WMScreenDisplay(WMWidgetScreen(w)), XSendEvent(WMScreenDisplay(WMWidgetScreen(w)),
DefaultRootWindow(WMScreenDisplay(WMWidgetScreen(w))), False, SubstructureRedirectMask, &ev); DefaultRootWindow(WMScreenDisplay(WMWidgetScreen(w))), False, SubstructureRedirectMask, &ev);
XFlush(WMScreenDisplay(WMWidgetScreen(w))); XFlush(WMScreenDisplay(WMWidgetScreen(w)));

View File

@@ -926,7 +926,22 @@ static void handleClientMessage(XEvent * event)
} }
} else if (event->xclient.message_type == _XA_WINDOWMAKER_COMMAND) { } else if (event->xclient.message_type == _XA_WINDOWMAKER_COMMAND) {
char *command;
size_t len;
len = sizeof(event->xclient.data.b) + 1;
command = wmalloc(len);
memset(command, 0, len);
strncpy(command, event->xclient.data.b, sizeof(event->xclient.data.b));
if (strncmp(command, "Reconfigure", sizeof("Reconfigure")) == 0) {
wwarning(_("Got Reconfigure command"));
wDefaultsCheckDomains(NULL); wDefaultsCheckDomains(NULL);
} else {
wwarning(_("Got unknown command %s"), command);
}
wfree(command);
} else if (event->xclient.message_type == _XA_WINDOWMAKER_WM_FUNCTION) { } else if (event->xclient.message_type == _XA_WINDOWMAKER_WM_FUNCTION) {
WApplication *wapp; WApplication *wapp;