diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/decoration.h | 17 | ||||
-rw-r--r-- | include/sway/server.h | 11 | ||||
-rw-r--r-- | include/sway/tree/container.h | 13 | ||||
-rw-r--r-- | include/sway/tree/view.h | 9 | ||||
-rw-r--r-- | include/sway/tree/workspace.h | 6 |
5 files changed, 53 insertions, 3 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 | |||
6 | struct 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 | |||
14 | struct 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 |
72 | void handle_xwayland_surface(struct wl_listener *listener, void *data); | 79 | void handle_xwayland_surface(struct wl_listener *listener, void *data); |
73 | #endif | 80 | #endif |
81 | void handle_server_decoration(struct wl_listener *listener, void *data); | ||
82 | |||
74 | #endif | 83 | #endif |
diff --git a/include/sway/tree/container.h b/include/sway/tree/container.h index 44ff9f7d..4d0e6003 100644 --- a/include/sway/tree/container.h +++ b/include/sway/tree/container.h | |||
@@ -113,7 +113,7 @@ struct sway_container { | |||
113 | 113 | ||
114 | enum sway_container_type type; | 114 | enum sway_container_type type; |
115 | enum sway_container_layout layout; | 115 | enum sway_container_layout layout; |
116 | enum sway_container_layout prev_layout; | 116 | enum sway_container_layout prev_split_layout; |
117 | 117 | ||
118 | bool is_sticky; | 118 | bool is_sticky; |
119 | 119 | ||
@@ -323,12 +323,23 @@ void container_floating_translate(struct sway_container *con, | |||
323 | double x_amount, double y_amount); | 323 | double x_amount, double y_amount); |
324 | 324 | ||
325 | /** | 325 | /** |
326 | * Choose an output for the floating container's new position. | ||
327 | */ | ||
328 | struct sway_container *container_floating_find_output( | ||
329 | struct sway_container *con); | ||
330 | |||
331 | /** | ||
326 | * Move a floating container to a new layout-local position. | 332 | * Move a floating container to a new layout-local position. |
327 | */ | 333 | */ |
328 | void container_floating_move_to(struct sway_container *con, | 334 | void container_floating_move_to(struct sway_container *con, |
329 | double lx, double ly); | 335 | double lx, double ly); |
330 | 336 | ||
331 | /** | 337 | /** |
338 | * Move a floating container to the center of the workspace. | ||
339 | */ | ||
340 | void container_floating_move_to_center(struct sway_container *con); | ||
341 | |||
342 | /** | ||
332 | * Mark a container as dirty if it isn't already. Dirty containers will be | 343 | * Mark a container as dirty if it isn't already. Dirty containers will be |
333 | * included in the next transaction then unmarked as dirty. | 344 | * included in the next transaction then unmarked as dirty. |
334 | */ | 345 | */ |
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 37fd02bc..c2225bcb 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -118,6 +118,8 @@ struct sway_view { | |||
118 | struct sway_xdg_shell_v6_view { | 118 | struct 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 { | |||
134 | struct sway_xdg_shell_view { | 136 | struct 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; |
@@ -316,6 +320,11 @@ void view_update_title(struct sway_view *view, bool force); | |||
316 | void view_execute_criteria(struct sway_view *view); | 320 | void view_execute_criteria(struct sway_view *view); |
317 | 321 | ||
318 | /** | 322 | /** |
323 | * Find any view that has the given mark and return it. | ||
324 | */ | ||
325 | struct sway_view *view_find_mark(char *mark); | ||
326 | |||
327 | /** | ||
319 | * Find any view that has the given mark and remove the mark from the view. | 328 | * Find any view that has the given mark and remove the mark from the view. |
320 | * Returns true if it matched a view. | 329 | * Returns true if it matched a view. |
321 | */ | 330 | */ |
diff --git a/include/sway/tree/workspace.h b/include/sway/tree/workspace.h index 3337f2c8..056f2329 100644 --- a/include/sway/tree/workspace.h +++ b/include/sway/tree/workspace.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _SWAY_WORKSPACE_H | 1 | #ifndef _SWAY_WORKSPACE_H |
2 | #define _SWAY_WORKSPACE_H | 2 | #define _SWAY_WORKSPACE_H |
3 | 3 | ||
4 | #include <stdbool.h> | ||
4 | #include "sway/tree/container.h" | 5 | #include "sway/tree/container.h" |
5 | 6 | ||
6 | struct sway_view; | 7 | struct sway_view; |
@@ -15,9 +16,12 @@ struct sway_workspace { | |||
15 | 16 | ||
16 | extern char *prev_workspace_name; | 17 | extern char *prev_workspace_name; |
17 | 18 | ||
19 | struct sway_container *workspace_get_initial_output(const char *name); | ||
20 | |||
18 | char *workspace_next_name(const char *output_name); | 21 | char *workspace_next_name(const char *output_name); |
19 | 22 | ||
20 | bool workspace_switch(struct sway_container *workspace); | 23 | bool workspace_switch(struct sway_container *workspace, |
24 | bool no_auto_back_and_forth); | ||
21 | 25 | ||
22 | struct sway_container *workspace_by_number(const char* name); | 26 | struct sway_container *workspace_by_number(const char* name); |
23 | 27 | ||