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) \