wNETWMCheckClientHints should be void
authorRodolfo García Peñas (kix) <kix@kix.es>
Tue, 23 Oct 2012 21:59:49 +0000 (23 23:59 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 28 Oct 2012 10:58:42 +0000 (28 10:58 +0000)
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
src/wmspec.h

index d2b335b..76e72a9 100644 (file)
@@ -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)
index fd70052..af75684 100644 (file)
@@ -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);