]> git.lizzy.rs Git - bspwm.git/blobdiff - window.c
New setting: leaf_monocle
[bspwm.git] / window.c
index d9d5082650721538c599c5ed3c8aa8deb15ab02b..2190b50fc692e1bcb0cf9844366c759f732c9dfb 100644 (file)
--- a/window.c
+++ b/window.c
@@ -386,7 +386,7 @@ void set_fullscreen(node_t *n, bool value)
        client_t *c = n->client;
 
        PRINTF("fullscreen %X: %s\n", c->window, BOOLSTR(value));
-       put_status(SBSC_MASK_WINDOW_FULLSCREEN, "window_fullscreen %s 0x%X\n", ONOFFSTR(value), c->window);
+       put_status(SBSC_MASK_WINDOW_STATE, "window_state fullscreen %s 0x%X\n", ONOFFSTR(value), c->window);
 
        c->fullscreen = value;
        if (value)
@@ -487,7 +487,7 @@ void set_urgency(monitor_t *m, desktop_t *d, node_t *n, bool value)
        n->client->urgent = value;
        window_draw_border(n, d->focus == n, m == mon);
 
-       put_status(SBSC_MASK_WINDOW_URGENT, "window_urgent %s 0x%X\n", ONOFFSTR(value), n->client->window);
+       put_status(SBSC_MASK_WINDOW_STATE, "window_state urgent %s 0x%X\n", ONOFFSTR(value), n->client->window);
        put_status(SBSC_MASK_REPORT);
 }
 
@@ -589,6 +589,8 @@ void restrain_floating_size(client_t *c, int *width, int *height)
 
 void query_pointer(xcb_window_t *win, xcb_point_t *pt)
 {
+       window_lower(motion_recorder);
+
        xcb_query_pointer_reply_t *qpr = xcb_query_pointer_reply(dpy, xcb_query_pointer(dpy, root), NULL);
 
        if (qpr != NULL) {
@@ -598,17 +600,8 @@ void query_pointer(xcb_window_t *win, xcb_point_t *pt)
                        *pt = (xcb_point_t) {qpr->root_x, qpr->root_y};
                free(qpr);
        }
-}
 
-bool window_focus(xcb_window_t win)
-{
-       coordinates_t loc;
-       if (locate_window(win, &loc)) {
-               if (loc.node != mon->desk->focus)
-                       focus_node(loc.monitor, loc.desktop, loc.node);
-               return true;
-       }
-       return false;
+       window_raise(motion_recorder);
 }
 
 void window_border_width(xcb_window_t win, uint32_t bw)
@@ -718,6 +711,31 @@ void toggle_visibility(void)
                update_input_focus();
 }
 
+void enable_motion_recorder(void)
+{
+       PUTS("motion recorder on");
+       window_raise(motion_recorder);
+       window_show(motion_recorder);
+}
+
+void disable_motion_recorder(void)
+{
+       PUTS("motion recorder off");
+       window_hide(motion_recorder);
+}
+
+void update_motion_recorder(void)
+{
+       xcb_get_geometry_reply_t *geo = xcb_get_geometry_reply(dpy, xcb_get_geometry(dpy, root), NULL);
+
+       if (geo != NULL) {
+               window_resize(motion_recorder, geo->width, geo->height);
+               PRINTF("update motion recorder size: %ux%u\n", geo->width, geo->height);
+       }
+
+       free(geo);
+}
+
 void update_input_focus(void)
 {
        set_input_focus(mon->desk->focus);
@@ -743,7 +761,9 @@ void center_pointer(xcb_rectangle_t r)
 {
        int16_t cx = r.x + r.width / 2;
        int16_t cy = r.y + r.height / 2;
+       window_lower(motion_recorder);
        xcb_warp_pointer(dpy, XCB_NONE, root, 0, 0, 0, 0, cx, cy);
+       window_raise(motion_recorder);
 }
 
 void get_atom(char *name, xcb_atom_t *atom)