From 027a720c17d6d4399a2bfb64d4e96ae20c601ea2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Tue, 23 Oct 2012 23:59:49 +0200 Subject: [PATCH] wNETWMCheckClientHints should be void The function wNETWMCheckClientHints returns a Boolean, but this value is never used, so can be removed. This patch removes the boolean returned, the variable hasState, and so some parts of the function changes. The patch also moves some variable definition to the same line: one type, one line. --- src/wmspec.c | 24 +++++++----------------- src/wmspec.h | 2 +- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/wmspec.c b/src/wmspec.c index d2b335b2..76e72a98 100644 --- a/src/wmspec.c +++ b/src/wmspec.c @@ -1193,15 +1193,12 @@ static void updateWindowType(WWindow * wwin) } } -Bool wNETWMCheckClientHints(WWindow * wwin, int *layer, int *workspace) +void wNETWMCheckClientHints(WWindow *wwin, int *layer, int *workspace) { Atom type_ret; - int fmt_ret; - unsigned long nitems_ret; - unsigned long bytes_after_ret; + int fmt_ret, i; + unsigned long nitems_ret, bytes_after_ret; long *data = NULL; - Bool hasState = False; - int i; if (XGetWindowProperty(dpy, wwin->client_win, net_wm_desktop, 0, 1, False, XA_CARDINAL, &type_ret, &fmt_ret, &nitems_ret, @@ -1214,8 +1211,6 @@ Bool wNETWMCheckClientHints(WWindow * wwin, int *layer, int *workspace) wwin->client_flags.omnipresent = 1; else *workspace = desktop; - - hasState = True; } if (XGetWindowProperty(dpy, wwin->client_win, net_wm_state, 0, 1, False, @@ -1223,11 +1218,10 @@ Bool wNETWMCheckClientHints(WWindow * wwin, int *layer, int *workspace) &bytes_after_ret, (unsigned char **)&data) == Success && data) { Atom *state = (Atom *) data; - for (i = 0; i < nitems_ret; ++i) { + for (i = 0; i < nitems_ret; ++i) doStateAtom(wwin, state[i], _NET_WM_STATE_ADD, True); - } + XFree(data); - hasState = True; } if (XGetWindowProperty(dpy, wwin->client_win, net_wm_window_type, 0, 1, False, @@ -1240,17 +1234,13 @@ Bool wNETWMCheckClientHints(WWindow * wwin, int *layer, int *workspace) break; } XFree(data); - hasState = True; } wNETWMUpdateActions(wwin, False); updateStrut(wwin, False); - if (updateStrut(wwin, True)) { - hasState = True; - } - wScreenUpdateUsableArea(wwin->screen_ptr); + updateStrut(wwin, True); - return hasState; + wScreenUpdateUsableArea(wwin->screen_ptr); } static Bool updateNetIconInfo(WWindow * wwin) diff --git a/src/wmspec.h b/src/wmspec.h index fd70052f..af756840 100644 --- a/src/wmspec.h +++ b/src/wmspec.h @@ -34,7 +34,7 @@ void wNETWMUpdateWorkarea(WScreen *scr, WArea usableArea); Bool wNETWMGetUsableArea(WScreen *scr, int head, WArea *area); void wNETWMCheckInitialClientState(WWindow *wwin); Bool wNETWMProcessClientMessage(XClientMessageEvent *event); -Bool wNETWMCheckClientHints(WWindow *wwin, int *layer, int *workspace); +void wNETWMCheckClientHints(WWindow *wwin, int *layer, int *workspace); Bool wNETWMCheckClientHintChange(WWindow *wwin, XPropertyEvent *event); void wNETWMUpdateActions(WWindow *wwin, Bool del); void wNETWMUpdateDesktop(WScreen *scr); -- 2.11.4.GIT