diff options
author | 2018-03-28 19:27:52 -0400 | |
---|---|---|
committer | 2018-03-28 19:27:52 -0400 | |
commit | ca809d25199b229b3da7d69f427eb67539dc7bc0 (patch) | |
tree | b28c55c464feb85c61f314a26487404fd63f4fb3 /include | |
parent | Merge pull request #1638 from swaywm/swaybg-layers (diff) | |
parent | Address review feedback (diff) | |
download | sway-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.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 @@ | |||
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 | |||
8 | struct 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 | struct sway_output; | ||
25 | void 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 | ||
7 | struct sway_server; | 9 | struct 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 | ||
47 | void handle_new_output(struct wl_listener *listener, void *data); | 51 | void handle_new_output(struct wl_listener *listener, void *data); |
48 | 52 | ||
53 | void handle_layer_shell_surface(struct wl_listener *listener, void *data); | ||
49 | void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); | 54 | void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data); |
50 | void handle_xwayland_surface(struct wl_listener *listener, void *data); | 55 | void handle_xwayland_surface(struct wl_listener *listener, void *data); |
51 | void handle_wl_shell_surface(struct wl_listener *listener, void *data); | 56 | void handle_wl_shell_surface(struct wl_listener *listener, void *data); |