diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-28 15:47:22 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-28 15:47:22 -0400 |
commit | 0c8a64942e087038806b353949c900e03fd764a8 (patch) | |
tree | a427ff9d8702ad5dbc6e5ede8851930662d010ef /include/sway | |
parent | 9070950eecded7bfa64e7bca3bb76b150ccc8b72 (diff) |
Add initial layer shell skeleton
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/layers.h | 24 | ||||
-rw-r--r-- | include/sway/output.h | 4 | ||||
-rw-r--r-- | include/sway/server.h | 5 |
3 files changed, 33 insertions, 0 deletions
diff --git a/include/sway/layers.h b/include/sway/layers.h new file mode 100644 index 00000000..73fb7cb8 --- /dev/null +++ b/include/sway/layers.h @@ -0,0 +1,24 @@ +#ifndef _SWAY_LAYERS_H +#define _SWAY_LAYERS_H +#include <stdbool.h> +#include <wlr/types/wlr_box.h> +#include <wlr/types/wlr_surface.h> +#include <wlr/types/wlr_layer_shell.h> + +struct sway_layer_surface { + struct wlr_layer_surface *layer_surface; + struct wl_list link; + + struct wl_listener destroy; + struct wl_listener map; + struct wl_listener unmap; + struct wl_listener surface_commit; + struct wl_listener output_destroy; + struct wl_listener output_mode; + struct wl_listener output_transform; + + bool configured; + struct wlr_box geo; +}; + +#endif diff --git a/include/sway/output.h b/include/sway/output.h index 95d64705..769d44d0 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -2,6 +2,7 @@ #define _SWAY_OUTPUT_H #include <time.h> #include <wayland-server.h> +#include <wlr/types/wlr_box.h> #include <wlr/types/wlr_output.h> struct sway_server; @@ -13,6 +14,9 @@ struct sway_output { struct sway_server *server; struct timespec last_frame; + struct wl_list layers[4]; // sway_layer_surface::link + struct wlr_box usable_area; + struct wl_listener frame; struct wl_listener output_destroy; }; diff --git a/include/sway/server.h b/include/sway/server.h index eb7fa2ff..25eb64fe 100644 --- a/include/sway/server.h +++ b/include/sway/server.h @@ -6,6 +6,7 @@ #include <wlr/backend/session.h> #include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_data_device.h> +#include <wlr/types/wlr_layer_shell.h> #include <wlr/types/wlr_xdg_shell_v6.h> #include <wlr/render/wlr_renderer.h> // TODO WLR: make Xwayland optional @@ -27,6 +28,9 @@ struct sway_server { struct wl_listener new_output; struct wl_listener output_frame; + struct wlr_layer_shell *layer_shell; + struct wl_listener layer_shell_surface; + struct wlr_xdg_shell_v6 *xdg_shell_v6; struct wl_listener xdg_shell_v6_surface; @@ -46,6 +50,7 @@ void server_run(struct sway_server *server); void handle_new_output(struct wl_listener *listener, void *data); +void handle_layer_shell_surface(struct wl_listener *listener, void *data); void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); void handle_xwayland_surface(struct wl_listener *listener, void *data); void handle_wl_shell_surface(struct wl_listener *listener, void *data); |