]> git.lizzy.rs Git - bspwm.git/commitdiff
Pass any input from presel window to window below
authorAelspire <aelspire@gmail.com>
Thu, 3 May 2018 12:38:03 +0000 (14:38 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 28 Aug 2018 18:22:19 +0000 (20:22 +0200)
Makefile
src/window.c

index 9f49aafb3c46a6ff7a22f7c2b5056891725cb02c..23aea6e3ec535ee36f7ebc526ebe68cddaba60b5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@ VERSION := $(shell $(VERCMD) || cat VERSION)
 CPPFLAGS += -D_POSIX_C_SOURCE=200809L -DVERSION=\"$(VERSION)\"
 CFLAGS   += -std=c99 -pedantic -Wall -Wextra
 LDFLAGS  ?=
-LDLIBS    = $(LDFLAGS) -lm -lxcb -lxcb-util -lxcb-keysyms -lxcb-icccm -lxcb-ewmh -lxcb-randr -lxcb-xinerama
+LDLIBS    = $(LDFLAGS) -lm -lxcb -lxcb-util -lxcb-keysyms -lxcb-icccm -lxcb-ewmh -lxcb-randr -lxcb-xinerama -lxcb-shape
 
 PREFIX    ?= /usr/local
 BINPREFIX ?= $(PREFIX)/bin
index 41bf15abd71122d115544cd77d9e2cec06f0ecfa..1229a0771112915988d26fe6ad8ae8facacee091 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include <string.h>
+#include <xcb/shape.h>
 #include "bspwm.h"
 #include "ewmh.h"
 #include "monitor.h"
@@ -262,13 +263,14 @@ void initialize_presel_feedback(node_t *n)
        }
 
        xcb_window_t win = xcb_generate_id(dpy);
-       uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK;
-       uint32_t values[] = {get_color_pixel(presel_feedback_color), 1, focus_follows_pointer ? XCB_EVENT_MASK_ENTER_WINDOW : 0};
+       uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_SAVE_UNDER;
+       uint32_t values[] = {get_color_pixel(presel_feedback_color), 1};
        xcb_create_window(dpy, XCB_COPY_FROM_PARENT, win, root, 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT,
                                  XCB_COPY_FROM_PARENT, mask, values);
 
        xcb_icccm_set_wm_class(dpy, win, sizeof(PRESEL_FEEDBACK_IC), PRESEL_FEEDBACK_IC);
-       window_grab_buttons(win);
+       /* Make presel window's input shape NULL to pass any input to window below */
+       xcb_shape_rectangles(dpy, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_INPUT, XCB_CLIP_ORDERING_UNSORTED, win, 0, 0, 0, NULL);
        stacking_list_t *s = stack_tail;
        while (s != NULL && !IS_TILED(s->node->client)) {
                s = s->prev;