mirror of
https://github.com/amiwm/amiwm.git
synced 2026-03-24 01:24:15 +00:00
icc: use compound literal rather than static object to return pointer
thus make mkcmessage reentrant (and a macro, rather than a function)
This commit is contained in:
14
icc.c
14
icc.c
@@ -78,20 +78,6 @@ void setstringprop(Window w, Atom a, char *str)
|
||||
XSetTextProperty(dpy, w, &txtp, a);
|
||||
}
|
||||
|
||||
XEvent *mkcmessage(Window w, Atom a, long x)
|
||||
{
|
||||
static XEvent ev;
|
||||
|
||||
memset(&ev, 0, sizeof(ev));
|
||||
ev.xclient.type = ClientMessage;
|
||||
ev.xclient.window = w;
|
||||
ev.xclient.message_type = a;
|
||||
ev.xclient.format = 32;
|
||||
ev.xclient.data.l[0] = x;
|
||||
ev.xclient.data.l[1] = CurrentTime;
|
||||
return &ev;
|
||||
}
|
||||
|
||||
void getwmstate(Client *c)
|
||||
{
|
||||
Atom *p;
|
||||
|
||||
9
icc.h
9
icc.h
@@ -24,4 +24,13 @@ extern Atom wm_state, wm_change_state, wm_protocols, wm_delete, wm_take_focus, w
|
||||
#define Psizeright 8
|
||||
#define Psizetrans 16
|
||||
|
||||
|
||||
#define mkcmessage(w, a, x, ...) (&(XEvent){.xclient = { \
|
||||
.type = ClientMessage, \
|
||||
.window = (w), \
|
||||
.message_type = (a), \
|
||||
.format = 32, \
|
||||
.data.l = {(long)(x), CurrentTime, __VA_ARGS__}, \
|
||||
}})
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user