aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-28 15:47:22 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-28 15:47:22 -0400
commit0c8a64942e087038806b353949c900e03fd764a8 (patch)
treea427ff9d8702ad5dbc6e5ede8851930662d010ef /include/sway
parentMerge pull request #1638 from swaywm/swaybg-layers (diff)
downloadsway-0c8a64942e087038806b353949c900e03fd764a8.tar.gz
sway-0c8a64942e087038806b353949c900e03fd764a8.tar.zst
sway-0c8a64942e087038806b353949c900e03fd764a8.zip
Add initial layer shell skeleton
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/layers.h24
-rw-r--r--include/sway/output.h4
-rw-r--r--include/sway/server.h5
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 @@
1#ifndef _SWAY_LAYERS_H
2#define _SWAY_LAYERS_H
3#include <stdbool.h>
4#include <wlr/types/wlr_box.h>
5#include <wlr/types/wlr_surface.h>
6#include <wlr/types/wlr_layer_shell.h>
7
8struct sway_layer_surface {
9 struct wlr_layer_surface *layer_surface;
10 struct wl_list link;
11
12 struct wl_listener destroy;
13 struct wl_listener map;
14 struct wl_listener unmap;
15 struct wl_listener surface_commit;
16 struct wl_listener output_destroy;
17 struct wl_listener output_mode;
18 struct wl_listener output_transform;
19
20 bool configured;
21 struct wlr_box geo;
22};
23
24#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 @@
2#define _SWAY_OUTPUT_H 2#define _SWAY_OUTPUT_H
3#include <time.h> 3#include <time.h>
4#include <wayland-server.h> 4#include <wayland-server.h>
5#include <wlr/types/wlr_box.h>
5#include <wlr/types/wlr_output.h> 6#include <wlr/types/wlr_output.h>
6 7
7struct sway_server; 8struct sway_server;
@@ -13,6 +14,9 @@ struct sway_output {
13 struct sway_server *server; 14 struct sway_server *server;
14 struct timespec last_frame; 15 struct timespec last_frame;
15 16
17 struct wl_list layers[4]; // sway_layer_surface::link
18 struct wlr_box usable_area;
19
16 struct wl_listener frame; 20 struct wl_listener frame;
17 struct wl_listener output_destroy; 21 struct wl_listener output_destroy;
18}; 22};
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 @@
6#include <wlr/backend/session.h> 6#include <wlr/backend/session.h>
7#include <wlr/types/wlr_compositor.h> 7#include <wlr/types/wlr_compositor.h>
8#include <wlr/types/wlr_data_device.h> 8#include <wlr/types/wlr_data_device.h>
9#include <wlr/types/wlr_layer_shell.h>
9#include <wlr/types/wlr_xdg_shell_v6.h> 10#include <wlr/types/wlr_xdg_shell_v6.h>
10#include <wlr/render/wlr_renderer.h> 11#include <wlr/render/wlr_renderer.h>
11// TODO WLR: make Xwayland optional 12// TODO WLR: make Xwayland optional
@@ -27,6 +28,9 @@ struct sway_server {
27 struct wl_listener new_output; 28 struct wl_listener new_output;
28 struct wl_listener output_frame; 29 struct wl_listener output_frame;
29 30
31 struct wlr_layer_shell *layer_shell;
32 struct wl_listener layer_shell_surface;
33
30 struct wlr_xdg_shell_v6 *xdg_shell_v6; 34 struct wlr_xdg_shell_v6 *xdg_shell_v6;
31 struct wl_listener xdg_shell_v6_surface; 35 struct wl_listener xdg_shell_v6_surface;
32 36
@@ -46,6 +50,7 @@ void server_run(struct sway_server *server);
46 50
47void handle_new_output(struct wl_listener *listener, void *data); 51void handle_new_output(struct wl_listener *listener, void *data);
48 52
53void handle_layer_shell_surface(struct wl_listener *listener, void *data);
49void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); 54void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data);
50void handle_xwayland_surface(struct wl_listener *listener, void *data); 55void handle_xwayland_surface(struct wl_listener *listener, void *data);
51void handle_wl_shell_surface(struct wl_listener *listener, void *data); 56void handle_wl_shell_surface(struct wl_listener *listener, void *data);