summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-19 10:27:53 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-19 10:27:53 -0700
commit8f529536e3183cb2ebecee71903edd135316b197 (patch)
treeff276f5d3bb5974592fe4aacd0471ee93a2df562
parentMerge pull request #87 from Luminarys/master (diff)
downloadsway-8f529536e3183cb2ebecee71903edd135316b197.tar.gz
sway-8f529536e3183cb2ebecee71903edd135316b197.tar.zst
sway-8f529536e3183cb2ebecee71903edd135316b197.zip
pointer uses its own modifiers
-rw-r--r--sway/handlers.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 5e8e05b8..71691d7d 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -15,7 +15,6 @@
15#include "focus.h" 15#include "focus.h"
16 16
17uint32_t keys_pressed[32]; 17uint32_t keys_pressed[32];
18uint32_t key_modifiers;
19int keys_pressed_length = 0; 18int keys_pressed_length = 0;
20 19
21 20
@@ -27,10 +26,6 @@ static bool m2_held = false;
27static bool resizing = false; 26static bool resizing = false;
28static bool lock_left, lock_right, lock_top, lock_bottom = false; 27static bool lock_left, lock_right, lock_top, lock_bottom = false;
29 28
30static bool floating_mod_pressed(void) {
31 return key_modifiers & config->floating_mod;
32}
33
34static bool pointer_test(swayc_t *view, void *_origin) { 29static bool pointer_test(swayc_t *view, void *_origin) {
35 const struct wlc_origin *origin = _origin; 30 const struct wlc_origin *origin = _origin;
36 // Determine the output that the view is under 31 // Determine the output that the view is under
@@ -295,7 +290,6 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier
295 return false; 290 return false;
296 } 291 }
297 bool cmd_success = false; 292 bool cmd_success = false;
298 key_modifiers = modifiers->mods;
299 293
300 struct sway_mode *mode = config->current_mode; 294 struct sway_mode *mode = config->current_mode;
301 // Lowercase if necessary 295 // Lowercase if necessary
@@ -497,7 +491,7 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
497 } 491 }
498 } 492 }
499 arrange_windows(pointer->parent, -1, -1); 493 arrange_windows(pointer->parent, -1, -1);
500 if (floating_mod_pressed()) { 494 if (modifiers->mods & config->floating_mod) {
501 dragging = m1_held; 495 dragging = m1_held;
502 resizing = m2_held; 496 resizing = m2_held;
503 int midway_x = pointer->x + pointer->width/2; 497 int midway_x = pointer->x + pointer->width/2;
@@ -516,7 +510,6 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
516 if (button == 272) { 510 if (button == 272) {
517 m1_held = false; 511 m1_held = false;
518 dragging = false; 512 dragging = false;
519 lock_top = lock_bottom = lock_left = lock_right = false;
520 } 513 }
521 if (button == 273) { 514 if (button == 273) {
522 m2_held = false; 515 m2_held = false;