summaryrefslogtreecommitdiffstats
path: root/include/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-08-06 11:32:17 -0400
committerLibravatar GitHub <noreply@github.com>2018-08-06 11:32:17 -0400
commitd8b65193c493e5826383a08593395a598ce4b503 (patch)
tree97a1da416928ad8d7d3cca2e3e7dd72c39f924b6 /include/sway
parentMerge pull request #2392 from ianyfan/commands (diff)
parentHandle views created after decoration mode is sent for xdg-shell-v6 (diff)
downloadsway-d8b65193c493e5826383a08593395a598ce4b503.tar.gz
sway-d8b65193c493e5826383a08593395a598ce4b503.tar.zst
sway-d8b65193c493e5826383a08593395a598ce4b503.zip
Merge pull request #2268 from emersion/server-decoration-borders
Enable borders on floating SSD xdg-shell views
Diffstat (limited to 'include/sway')
-rw-r--r--include/sway/decoration.h17
-rw-r--r--include/sway/server.h11
-rw-r--r--include/sway/tree/view.h4
3 files changed, 31 insertions, 1 deletions
diff --git a/include/sway/decoration.h b/include/sway/decoration.h
new file mode 100644
index 00000000..7916746e
--- /dev/null
+++ b/include/sway/decoration.h
@@ -0,0 +1,17 @@
1#ifndef _SWAY_DECORATION_H
2#define _SWAY_DECORATION_H
3
4#include <wlr/types/wlr_server_decoration.h>
5
6struct sway_server_decoration {
7 struct wlr_server_decoration *wlr_server_decoration;
8 struct wl_list link;
9
10 struct wl_listener destroy;
11 struct wl_listener mode;
12};
13
14struct sway_server_decoration *decoration_from_surface(
15 struct wlr_surface *surface);
16
17#endif
diff --git a/include/sway/server.h b/include/sway/server.h
index a3782f91..b93584b6 100644
--- a/include/sway/server.h
+++ b/include/sway/server.h
@@ -4,12 +4,13 @@
4#include <wayland-server.h> 4#include <wayland-server.h>
5#include <wlr/backend.h> 5#include <wlr/backend.h>
6#include <wlr/backend/session.h> 6#include <wlr/backend/session.h>
7#include <wlr/render/wlr_renderer.h>
7#include <wlr/types/wlr_compositor.h> 8#include <wlr/types/wlr_compositor.h>
8#include <wlr/types/wlr_data_device.h> 9#include <wlr/types/wlr_data_device.h>
9#include <wlr/types/wlr_layer_shell.h> 10#include <wlr/types/wlr_layer_shell.h>
11#include <wlr/types/wlr_server_decoration.h>
10#include <wlr/types/wlr_xdg_shell_v6.h> 12#include <wlr/types/wlr_xdg_shell_v6.h>
11#include <wlr/types/wlr_xdg_shell.h> 13#include <wlr/types/wlr_xdg_shell.h>
12#include <wlr/render/wlr_renderer.h>
13// TODO WLR: make Xwayland optional 14// TODO WLR: make Xwayland optional
14#include "list.h" 15#include "list.h"
15#include "config.h" 16#include "config.h"
@@ -42,11 +43,17 @@ struct sway_server {
42 43
43 struct wlr_xdg_shell *xdg_shell; 44 struct wlr_xdg_shell *xdg_shell;
44 struct wl_listener xdg_shell_surface; 45 struct wl_listener xdg_shell_surface;
46
45#ifdef HAVE_XWAYLAND 47#ifdef HAVE_XWAYLAND
46 struct sway_xwayland xwayland; 48 struct sway_xwayland xwayland;
47 struct wl_listener xwayland_surface; 49 struct wl_listener xwayland_surface;
48 struct wl_listener xwayland_ready; 50 struct wl_listener xwayland_ready;
49#endif 51#endif
52
53 struct wlr_server_decoration_manager *server_decoration_manager;
54 struct wl_listener server_decoration;
55 struct wl_list decorations; // sway_server_decoration::link
56
50 bool debug_txn_timings; 57 bool debug_txn_timings;
51 58
52 list_t *transactions; 59 list_t *transactions;
@@ -71,4 +78,6 @@ void handle_xdg_shell_surface(struct wl_listener *listener, void *data);
71#ifdef HAVE_XWAYLAND 78#ifdef HAVE_XWAYLAND
72void handle_xwayland_surface(struct wl_listener *listener, void *data); 79void handle_xwayland_surface(struct wl_listener *listener, void *data);
73#endif 80#endif
81void handle_server_decoration(struct wl_listener *listener, void *data);
82
74#endif 83#endif
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h
index 4a3f01e7..c2225bcb 100644
--- a/include/sway/tree/view.h
+++ b/include/sway/tree/view.h
@@ -118,6 +118,8 @@ struct sway_view {
118struct sway_xdg_shell_v6_view { 118struct sway_xdg_shell_v6_view {
119 struct sway_view view; 119 struct sway_view view;
120 120
121 enum wlr_server_decoration_manager_mode deco_mode;
122
121 struct wl_listener commit; 123 struct wl_listener commit;
122 struct wl_listener request_move; 124 struct wl_listener request_move;
123 struct wl_listener request_resize; 125 struct wl_listener request_resize;
@@ -134,6 +136,8 @@ struct sway_xdg_shell_v6_view {
134struct sway_xdg_shell_view { 136struct sway_xdg_shell_view {
135 struct sway_view view; 137 struct sway_view view;
136 138
139 enum wlr_server_decoration_manager_mode deco_mode;
140
137 struct wl_listener commit; 141 struct wl_listener commit;
138 struct wl_listener request_move; 142 struct wl_listener request_move;
139 struct wl_listener request_resize; 143 struct wl_listener request_resize;