summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-28 19:27:52 -0400
committerLibravatar GitHub <noreply@github.com>2018-03-28 19:27:52 -0400
commitca809d25199b229b3da7d69f427eb67539dc7bc0 (patch)
treeb28c55c464feb85c61f314a26487404fd63f4fb3 /include
parentMerge pull request #1638 from swaywm/swaybg-layers (diff)
parentAddress review feedback (diff)
downloadsway-ca809d25199b229b3da7d69f427eb67539dc7bc0.tar.gz
sway-ca809d25199b229b3da7d69f427eb67539dc7bc0.tar.zst
sway-ca809d25199b229b3da7d69f427eb67539dc7bc0.zip
Merge pull request #1642 from swaywm/layer-shell
Implement layer shell (rendering)
Diffstat (limited to 'include')
-rw-r--r--include/sway/layers.h27
-rw-r--r--include/sway/output.h10
-rw-r--r--include/sway/server.h5
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 @@
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
24struct sway_output;
25void arrange_layers(struct sway_output *output);
26
27#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 @@
1#ifndef _SWAY_OUTPUT_H 1#ifndef _SWAY_OUTPUT_H
2#define _SWAY_OUTPUT_H 2#define _SWAY_OUTPUT_H
3#include <time.h> 3#include <time.h>
4#include <unistd.h>
4#include <wayland-server.h> 5#include <wayland-server.h>
6#include <wlr/types/wlr_box.h>
5#include <wlr/types/wlr_output.h> 7#include <wlr/types/wlr_output.h>
6 8
7struct sway_server; 9struct sway_server;
@@ -13,8 +15,14 @@ struct sway_output {
13 struct sway_server *server; 15 struct sway_server *server;
14 struct timespec last_frame; 16 struct timespec last_frame;
15 17
18 struct wl_list layers[4]; // sway_layer_surface::link
19 struct wlr_box usable_area;
20
16 struct wl_listener frame; 21 struct wl_listener frame;
17 struct wl_listener output_destroy; 22 struct wl_listener destroy;
23 struct wl_listener mode;
24
25 pid_t bg_pid;
18}; 26};
19 27
20#endif 28#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 @@
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);