From d32a2218f414a9056a00f8e0ef8db1e04b983b16 Mon Sep 17 00:00:00 2001 From: Amos Bird Date: Mon, 19 Nov 2018 22:21:55 +0800 Subject: [PATCH] . --- src/helpers.h | 3 ++- src/pointer.c | 6 +++++- src/tree.c | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/helpers.h b/src/helpers.h index 44787971..8a9f29c9 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -65,7 +65,8 @@ #define SMALEN 32 #define INIT_CAP 8 -#define cleaned_mask(m) (m & ~(num_lock | scroll_lock | caps_lock)) +/* #define cleaned_mask(m) (m & ~(num_lock | scroll_lock | caps_lock)) */ +#define cleaned_mask(m) (m & ~(num_lock | scroll_lock)) #define streq(s1, s2) (strcmp((s1), (s2)) == 0) #define unsigned_subtract(a, b) \ do { \ diff --git a/src/pointer.c b/src/pointer.c index 1bc6a6bb..ff067be6 100644 --- a/src/pointer.c +++ b/src/pointer.c @@ -50,11 +50,15 @@ void pointer_init(void) void window_grab_buttons(xcb_window_t win) { + coordinates_t loc; + bool grab = false; + if (locate_window(win, &loc)) + grab = loc.node->client->state == STATE_FLOATING; for (unsigned int i = 0; i < LENGTH(BUTTONS); i++) { if (click_to_focus == (int8_t) XCB_BUTTON_INDEX_ANY || click_to_focus == (int8_t) BUTTONS[i]) { window_grab_button(win, BUTTONS[i], XCB_NONE); } - if (pointer_actions[i] != ACTION_NONE) { + if (grab && pointer_actions[i] != ACTION_NONE) { window_grab_button(win, BUTTONS[i], pointer_modifier); } } diff --git a/src/tree.c b/src/tree.c index 5f27ed98..4005f192 100644 --- a/src/tree.c +++ b/src/tree.c @@ -1514,6 +1514,7 @@ bool find_closest_node(coordinates_t *ref, coordinates_t *dst, cycle_dir_t dir, monitor_t *m = ref->monitor; desktop_t *d = ref->desktop; node_t *n = ref->node; + if (!n) return false; n = (dir == CYCLE_PREV ? prev_leaf(n, d->root) : next_leaf(n, d->root)); #define HANDLE_BOUNDARIES(m, d, n) \