aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/Iconify.c
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/src/Iconify.c')
-rw-r--r--libX11/src/Iconify.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/libX11/src/Iconify.c b/libX11/src/Iconify.c
index 3a969d741..9da416596 100644
--- a/libX11/src/Iconify.c
+++ b/libX11/src/Iconify.c
@@ -67,19 +67,23 @@ Status XIconifyWindow (
Window w,
int screen)
{
- XClientMessageEvent ev;
- Window root = RootWindow (dpy, screen);
Atom prop;
prop = XInternAtom (dpy, "WM_CHANGE_STATE", False);
- if (prop == None) return False;
+ if (prop == None)
+ return False;
+ else {
+ XClientMessageEvent ev = {
+ .type = ClientMessage,
+ .window = w,
+ .message_type = prop,
+ .format = 32,
+ .data.l[0] = IconicState
+ };
+ Window root = RootWindow (dpy, screen);
- ev.type = ClientMessage;
- ev.window = w;
- ev.message_type = prop;
- ev.format = 32;
- ev.data.l[0] = IconicState;
- return (XSendEvent (dpy, root, False,
- SubstructureRedirectMask|SubstructureNotifyMask,
- (XEvent *)&ev));
+ return (XSendEvent (dpy, root, False,
+ SubstructureRedirectMask|SubstructureNotifyMask,
+ (XEvent *)&ev));
+ }
}