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:
committed by
Carlos R. Mafra
parent
e7a46d5cdf
commit
81aaed2bf8
@@ -116,7 +116,6 @@ static void save(WMWidget * w, void *data)
|
||||
WMPropList *p1, *p2;
|
||||
WMPropList *keyList;
|
||||
WMPropList *key;
|
||||
char *msg = "Reconfigure";
|
||||
XEvent ev;
|
||||
|
||||
/* 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.window = DefaultRootWindow(WMScreenDisplay(WMWidgetScreen(w)));
|
||||
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)),
|
||||
DefaultRootWindow(WMScreenDisplay(WMWidgetScreen(w))), False, SubstructureRedirectMask, &ev);
|
||||
XFlush(WMScreenDisplay(WMWidgetScreen(w)));
|
||||
|
||||
15
src/event.c
15
src/event.c
@@ -926,7 +926,22 @@ static void handleClientMessage(XEvent * event)
|
||||
}
|
||||
} 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);
|
||||
} else {
|
||||
wwarning(_("Got unknown command %s"), command);
|
||||
}
|
||||
|
||||
wfree(command);
|
||||
|
||||
} else if (event->xclient.message_type == _XA_WINDOWMAKER_WM_FUNCTION) {
|
||||
WApplication *wapp;
|
||||
|
||||
Reference in New Issue
Block a user