From ccf2b24de84f622086cf4fbaa6a3c5dd1792d000 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Sat, 20 Nov 2021 21:56:33 +0500 Subject: [PATCH] Improve code of func "configure" --- src/dwm.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/dwm.c b/src/dwm.c index d48b909..f987ac4 100644 --- a/src/dwm.c +++ b/src/dwm.c @@ -477,20 +477,23 @@ void cleanupmon(Monitor *mon) void configure(Client *c) { - XConfigureEvent ce; + XConfigureEvent ce = { + .type = ConfigureNotify, + .serial = 0, + .send_event = False, + .display = dpy, + .event = c->win, + .window = c->win, + .x = c->x, + .y = c->y, + .width = c->w, + .height = c->h, + .border_width = c->bw, + .above = None, + .override_redirect = False, + }; - ce.type = ConfigureNotify; - ce.display = dpy; - ce.event = c->win; - ce.window = c->win; - ce.x = c->x; - ce.y = c->y; - ce.width = c->w; - ce.height = c->h; - ce.border_width = c->bw; - ce.above = None; - ce.override_redirect = False; - XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent *)&ce); + XSendEvent(dpy, c->win, False, StructureNotifyMask, (XEvent*)&ce); } Monitor *createmon()