diff options
Diffstat (limited to 'include/sway')
-rw-r--r-- | include/sway/layers.h | 27 | ||||
-rw-r--r-- | include/sway/output.h | 10 | ||||
-rw-r--r-- | include/sway/server.h | 5 |
3 files changed, 41 insertions, 1 deletions
diff --git a/include/sway/layers.h b/include/sway/layers.h new file mode 100644 index 00000000..22054be1 --- /dev/null +++ b/include/sway/layers.h @@ -0,0 +1,27 @@ +#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; +}; + +struct sway_output; +void arrange_layers(struct sway_output *output); + +#endif diff --git a/include/sway/output.h b/include/sway/output.h index 95d64705..f899230f 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -1,7 +1,9 @@ #ifndef _SWAY_OUTPUT_H #define _SWAY_OUTPUT_H #include <time.h> +#include <unistd.h> #include <wayland-server.h> +#include <wlr/types/wlr_box.h> #include <wlr/types/wlr_output.h> struct sway_server; @@ -13,8 +15,14 @@ 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; + struct wl_listener destroy; + struct wl_listener mode; + + pid_t bg_pid; }; #endif 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); |