From e541ba3d876de8ce2812482fc6bfa13b236c6a58 Mon Sep 17 00:00:00 2001 From: Luminarys Date: Tue, 18 Aug 2015 01:33:15 -0500 Subject: Added in basic, but semi-broken moving/resizing functionality to floating windows --- include/config.h | 2 ++ include/handlers.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/config.h b/include/config.h index 38e93eb8..b9511aac 100644 --- a/include/config.h +++ b/include/config.h @@ -3,6 +3,7 @@ #include #include +#include #include "list.h" struct sway_variable { @@ -32,6 +33,7 @@ struct sway_config { list_t *cmd_queue; list_t *workspace_outputs; struct sway_mode *current_mode; + uint32_t floating_mod; // Flags bool focus_follows_mouse; diff --git a/include/handlers.h b/include/handlers.h index d1742cce..c954ce61 100644 --- a/include/handlers.h +++ b/include/handlers.h @@ -5,7 +5,7 @@ #include extern struct wlc_interface interface; - +extern uint32_t keys_pressed[32]; //set focus to current pointer location and return focused container swayc_t *focus_pointer(void); -- cgit v1.2.3 From 11321ca2dd355be82175213795d88dcbfd0540ee Mon Sep 17 00:00:00 2001 From: taiyu Date: Tue, 18 Aug 2015 00:28:44 -0700 Subject: changed handling of focus, handling of view by type --- include/container.h | 2 ++ include/focus.h | 36 ++++++++++++++++++++++++++++++++++++ include/handlers.h | 5 ++--- include/movement.h | 17 ----------------- 4 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 include/focus.h delete mode 100644 include/movement.h (limited to 'include') diff --git a/include/container.h b/include/container.h index e395a55b..5f386368 100644 --- a/include/container.h +++ b/include/container.h @@ -45,6 +45,8 @@ struct sway_container { bool is_floating; + bool is_focused; + int weight; char *name; diff --git a/include/focus.h b/include/focus.h new file mode 100644 index 00000000..185910f3 --- /dev/null +++ b/include/focus.h @@ -0,0 +1,36 @@ +#ifndef _SWAY_FOCUS_H +#define _SWAY_FOCUS_H +#include "container.h" + +enum movement_direction { + MOVE_LEFT, + MOVE_RIGHT, + MOVE_UP, + MOVE_DOWN, + MOVE_PARENT +}; + +//focused_container - the container found by following the `focused` pointer +//from a given container to a container with `is_focused` boolean set +//--- +//focused_view - the container found by following the `focused` pointer from a +//given container to a view. +//--- + +swayc_t *get_focused_container(swayc_t *parent); +swayc_t *get_focused_view(swayc_t *parent); + +void set_focused_container(swayc_t *container); +void set_focused_container_for(swayc_t *ancestor, swayc_t *container); + +//lock focused container/view. locked by windows with OVERRIDE attribute +//and unlocked when they are destroyed + +extern bool locked_container_focus; +extern bool locked_view_focus; + + +bool move_focus(enum movement_direction direction); + +#endif + diff --git a/include/handlers.h b/include/handlers.h index d1742cce..6ea4bbf1 100644 --- a/include/handlers.h +++ b/include/handlers.h @@ -1,12 +1,11 @@ #ifndef _SWAY_HANDLERS_H #define _SWAY_HANDLERS_H - +#include "container.h" #include #include extern struct wlc_interface interface; -//set focus to current pointer location and return focused container -swayc_t *focus_pointer(void); +swayc_t *container_under_pointer(void); #endif diff --git a/include/movement.h b/include/movement.h deleted file mode 100644 index dd701877..00000000 --- a/include/movement.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SWAY_MOVEMENT_H -#define _SWAY_MOVEMENT_H - -#include -#include "list.h" - -enum movement_direction { - MOVE_LEFT, - MOVE_RIGHT, - MOVE_UP, - MOVE_DOWN, - MOVE_PARENT -}; - -bool move_focus(enum movement_direction direction); - -#endif -- cgit v1.2.3 From 63bc0d3b5451f4668186c98a1f283f3e0a104cfe Mon Sep 17 00:00:00 2001 From: taiyu Date: Tue, 18 Aug 2015 02:46:14 -0700 Subject: more changes --- include/layout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/layout.h b/include/layout.h index a7f43fda..26d00ce4 100644 --- a/include/layout.h +++ b/include/layout.h @@ -13,7 +13,7 @@ void add_child(swayc_t *parent, swayc_t *child); //Returns parent container which needs to be rearranged. swayc_t *add_sibling(swayc_t *sibling, swayc_t *child); swayc_t *replace_child(swayc_t *child, swayc_t *new_child); -swayc_t *remove_child(swayc_t *parent, swayc_t *child); +swayc_t *remove_child(swayc_t *child); //Layout void arrange_windows(swayc_t *container, int width, int height); -- cgit v1.2.3 From b132f67e7bb5017c73658cec8d297060033890e8 Mon Sep 17 00:00:00 2001 From: taiyu Date: Tue, 18 Aug 2015 03:48:41 -0700 Subject: minor fixes --- include/config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/config.h b/include/config.h index b9511aac..9243bf35 100644 --- a/include/config.h +++ b/include/config.h @@ -33,17 +33,17 @@ struct sway_config { list_t *cmd_queue; list_t *workspace_outputs; struct sway_mode *current_mode; - uint32_t floating_mod; + uint32_t floating_mod; // Flags bool focus_follows_mouse; bool mouse_warping; - bool active; - bool failed; + bool active; + bool failed; bool reloading; }; -bool load_config(); +bool load_config(void); bool read_config(FILE *file, bool is_active); char *do_var_replacement(struct sway_config *config, char *str); -- cgit v1.2.3