]> Pileus Git - wmpus/blobdiff - sys-x11.c
Add wm_handle_state functiton
[wmpus] / sys-x11.c
index 483844f17e151ce26d0636b16fc367510650233f..2120ee07931b427dc4be43c6486655f3c0f73197 100644 (file)
--- a/sys-x11.c
+++ b/sys-x11.c
@@ -454,12 +454,11 @@ static void process_event(int type, XEvent *xe, win_t *root)
                    (cme->message_type == atoms[NET_STATE]) &&
                    (cme->data.l[1] == atoms[NET_FULL] ||
                     cme->data.l[2] == atoms[NET_FULL])) {
-                       if (cme->data.l[0] == 1 || /* _NET_WM_STATE_ADD    */
-                          (cme->data.l[0] == 2 && /* _NET_WM_STATE_TOGGLE */
-                           win->state != ST_FULL))
-                               sys_show(win, ST_FULL);
-                       else
-                               sys_show(win, ST_SHOW);
+                       state_t next = (cme->data.l[0] == 1 || /* _NET_WM_STATE_ADD    */
+                                      (cme->data.l[0] == 2 && /* _NET_WM_STATE_TOGGLE */
+                                       win->state != ST_FULL)) ? ST_FULL : ST_SHOW;
+                       wm_handle_state(win, win->state, next);
+                       sys_show(win, next);
                }
        }
        else if (type == PropertyNotify) {
@@ -555,6 +554,10 @@ void sys_show(win_t *win, state_t state)
                XMapWindow(win->sys->dpy, win->sys->xid);
                XSync(win->sys->dpy, False);
                break;
+       case ST_MAX:
+               printf("sys_show: max %p\n", win);
+               XMapWindow(win->sys->dpy, win->sys->xid);
+               break;
        case ST_FULL:
                printf("sys_show: full %p\n", win);
                win_t *screen = NULL;