aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-02-04 13:39:10 -0500
committerTony Crisci <tony@dubstepdish.com>2018-02-04 14:08:54 -0500
commit515150229847c9ebdfd0cabb6f0026fca9d57a23 (patch)
tree8a50ce0ac8ce4dc2ec973c63c68dc45378c50737 /include
parentb28602aa7425cf435150e6008624429737e037d3 (diff)
basic focus overhaul
Diffstat (limited to 'include')
-rw-r--r--include/sway/container.h6
-rw-r--r--include/sway/input/seat.h16
-rw-r--r--include/sway/layout.h6
3 files changed, 27 insertions, 1 deletions
diff --git a/include/sway/container.h b/include/sway/container.h
index 0c66932d..997240bd 100644
--- a/include/sway/container.h
+++ b/include/sway/container.h
@@ -162,4 +162,10 @@ void container_map(swayc_t *container,
swayc_t *swayc_at(swayc_t *parent, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy);
+/**
+ * Get a list of containers that are descendents of the container in rendering
+ * order
+ */
+list_t *container_list_children(swayc_t *con);
+
#endif
diff --git a/include/sway/input/seat.h b/include/sway/input/seat.h
index b21cbccb..8d5d6b75 100644
--- a/include/sway/input/seat.h
+++ b/include/sway/input/seat.h
@@ -12,14 +12,26 @@ struct sway_seat_device {
struct wl_list link; // sway_seat::devices
};
+struct sway_seat_container {
+ struct sway_seat *seat;
+ swayc_t *container;
+
+ struct wl_list link; // sway_seat::focus_stack
+
+ struct wl_listener destroy;
+};
+
struct sway_seat {
struct wlr_seat *wlr_seat;
struct seat_config *config;
struct sway_cursor *cursor;
struct sway_input_manager *input;
- swayc_t *focus;
+
+ bool has_focus;
+ struct wl_list focus_stack; // list of containers in focus order
struct wl_listener focus_destroy;
+ struct wl_listener new_container;
struct wl_list devices; // sway_seat_device::link
@@ -44,6 +56,8 @@ void sway_seat_configure_xcursor(struct sway_seat *seat);
void sway_seat_set_focus(struct sway_seat *seat, swayc_t *container);
+swayc_t *sway_seat_get_focus(struct sway_seat *seat, swayc_t *container);
+
void sway_seat_set_config(struct sway_seat *seat, struct seat_config *seat_config);
#endif
diff --git a/include/sway/layout.h b/include/sway/layout.h
index af561453..69a66674 100644
--- a/include/sway/layout.h
+++ b/include/sway/layout.h
@@ -2,6 +2,7 @@
#define _SWAY_LAYOUT_H
#include <wlr/types/wlr_output_layout.h>
+#include "sway/container.h"
struct sway_container;
@@ -11,10 +12,15 @@ struct sway_root {
struct wl_listener output_layout_change;
struct wl_list unmanaged_views; // sway_view::unmanaged_view_link
+
+ struct {
+ struct wl_signal new_container;
+ } events;
};
void init_layout(void);
void add_child(struct sway_container *parent, struct sway_container *child);
+swayc_t *add_sibling(swayc_t *parent, swayc_t *child);
struct sway_container *remove_child(struct sway_container *child);
enum swayc_layouts default_layout(struct sway_container *output);
void sort_workspaces(struct sway_container *output);