From 865b30f13814beb798f49d6e2372cc44d8103b29 Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Wed, 28 Oct 2015 00:22:52 +0100 Subject: container: Move container_under_pointer here from handlers. --- include/container.h | 4 ++++ include/handlers.h | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/container.h b/include/container.h index ae9a9fc5..e1ecca92 100644 --- a/include/container.h +++ b/include/container.h @@ -5,6 +5,8 @@ typedef struct sway_container swayc_t; #include "layout.h" +extern struct wlc_origin mouse_origin; + enum swayc_types{ C_ROOT, C_OUTPUT, @@ -98,6 +100,8 @@ swayc_t *swayc_by_name(const char *name); swayc_t *swayc_active_output(void); swayc_t *swayc_active_workspace(void); swayc_t *swayc_active_workspace_for(swayc_t *view); +// set focus to current pointer location and return focused container +swayc_t *container_under_pointer(void); // Container information diff --git a/include/handlers.h b/include/handlers.h index 4c71f953..d7f6ffdd 100644 --- a/include/handlers.h +++ b/include/handlers.h @@ -5,10 +5,6 @@ #include extern struct wlc_interface interface; -extern struct wlc_origin mouse_origin; extern uint32_t keys_pressed[32]; -// set focus to current pointer location and return focused container -swayc_t *container_under_pointer(void); - #endif -- cgit v1.2.3 From 4799d07ac1bb08a770ee702eb3fd0ab4654f878a Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Wed, 28 Oct 2015 00:41:28 +0100 Subject: input_state: Extract 'pointer_position_set' function from handlers. --- include/input_state.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/input_state.h b/include/input_state.h index d87ae18c..dd5d71a8 100644 --- a/include/input_state.h +++ b/include/input_state.h @@ -65,6 +65,8 @@ extern struct pointer_state { int mode; } pointer_state; +void pointer_position_set(struct wlc_origin *new_origin, bool force_focus); + // on button release unset mode depending on the button. // on button press set mode conditionally depending on the button void pointer_mode_set(uint32_t button, bool condition); -- cgit v1.2.3 From 78ca6197697d4f07eddf0c544daff85603adab90 Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Mon, 26 Oct 2015 12:20:32 +0100 Subject: commands: Learn mouse_warping. Place mouse at center of focused view when changing to a workspace on a different output, if option is enabled. (This replicates existing i3 option.) This can be triggered in multiple ways: A) via `workspace ` which changes output B) via `focus ` which changes output C) via `focus output ` which (obviously) changes output --- include/commands.h | 1 + include/input_state.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/commands.h b/include/commands.h index 8e53c74d..f6777930 100644 --- a/include/commands.h +++ b/include/commands.h @@ -2,6 +2,7 @@ #define _SWAY_COMMANDS_H #include #include +#include #include "config.h" diff --git a/include/input_state.h b/include/input_state.h index dd5d71a8..52759052 100644 --- a/include/input_state.h +++ b/include/input_state.h @@ -66,6 +66,7 @@ extern struct pointer_state { } pointer_state; void pointer_position_set(struct wlc_origin *new_origin, bool force_focus); +void center_pointer_on(swayc_t *view); // on button release unset mode depending on the button. // on button press set mode conditionally depending on the button -- cgit v1.2.3 From 5ba47d4a44b21500ed3af2670cb1c807b7fed850 Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Thu, 29 Oct 2015 18:02:02 +0100 Subject: input_state: Remove mouse_origin (x&y). Query wlc instead. --- include/input_state.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include') diff --git a/include/input_state.h b/include/input_state.h index 52759052..a1f238e1 100644 --- a/include/input_state.h +++ b/include/input_state.h @@ -48,11 +48,6 @@ extern struct pointer_state { struct pointer_button_state right; struct pointer_button_state scroll; - // pointer position - struct mouse_origin{ - int x, y; - } origin; - // change in pointer position struct { int x, y; -- cgit v1.2.3 From 515ed86f4d8106d4396d5b8056fdf5600e606458 Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Thu, 29 Oct 2015 19:13:52 +0100 Subject: container.h: Remove unused. --- include/container.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/container.h b/include/container.h index e1ecca92..d5eb27c1 100644 --- a/include/container.h +++ b/include/container.h @@ -5,8 +5,6 @@ typedef struct sway_container swayc_t; #include "layout.h" -extern struct wlc_origin mouse_origin; - enum swayc_types{ C_ROOT, C_OUTPUT, -- cgit v1.2.3