diff options
Diffstat (limited to 'include/sway/tree/view.h')
-rw-r--r-- | include/sway/tree/view.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index e071e6c9..95708a04 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _SWAY_VIEW_H | 1 | #ifndef _SWAY_VIEW_H |
2 | #define _SWAY_VIEW_H | 2 | #define _SWAY_VIEW_H |
3 | #include <wayland-server-core.h> | 3 | #include <wayland-server-core.h> |
4 | #include <wlr/types/wlr_surface.h> | 4 | #include <wlr/types/wlr_compositor.h> |
5 | #include "config.h" | 5 | #include "config.h" |
6 | #if HAVE_XWAYLAND | 6 | #if HAVE_XWAYLAND |
7 | #include <wlr/xwayland.h> | 7 | #include <wlr/xwayland.h> |
@@ -108,11 +108,10 @@ struct sway_view { | |||
108 | list_t *executed_criteria; // struct criteria * | 108 | list_t *executed_criteria; // struct criteria * |
109 | 109 | ||
110 | union { | 110 | union { |
111 | struct wlr_xdg_surface *wlr_xdg_surface; | 111 | struct wlr_xdg_toplevel *wlr_xdg_toplevel; |
112 | #if HAVE_XWAYLAND | 112 | #if HAVE_XWAYLAND |
113 | struct wlr_xwayland_surface *wlr_xwayland_surface; | 113 | struct wlr_xwayland_surface *wlr_xwayland_surface; |
114 | #endif | 114 | #endif |
115 | struct wlr_wl_shell_surface *wlr_wl_shell_surface; | ||
116 | }; | 115 | }; |
117 | 116 | ||
118 | struct { | 117 | struct { |
@@ -132,7 +131,6 @@ struct sway_xdg_shell_view { | |||
132 | struct wl_listener commit; | 131 | struct wl_listener commit; |
133 | struct wl_listener request_move; | 132 | struct wl_listener request_move; |
134 | struct wl_listener request_resize; | 133 | struct wl_listener request_resize; |
135 | struct wl_listener request_maximize; | ||
136 | struct wl_listener request_fullscreen; | 134 | struct wl_listener request_fullscreen; |
137 | struct wl_listener set_title; | 135 | struct wl_listener set_title; |
138 | struct wl_listener set_app_id; | 136 | struct wl_listener set_app_id; |
@@ -171,6 +169,7 @@ struct sway_xwayland_unmanaged { | |||
171 | 169 | ||
172 | int lx, ly; | 170 | int lx, ly; |
173 | 171 | ||
172 | struct wl_listener request_activate; | ||
174 | struct wl_listener request_configure; | 173 | struct wl_listener request_configure; |
175 | struct wl_listener request_fullscreen; | 174 | struct wl_listener request_fullscreen; |
176 | struct wl_listener commit; | 175 | struct wl_listener commit; |
@@ -184,7 +183,7 @@ struct sway_xwayland_unmanaged { | |||
184 | struct sway_view_child; | 183 | struct sway_view_child; |
185 | 184 | ||
186 | struct sway_view_child_impl { | 185 | struct sway_view_child_impl { |
187 | void (*get_root_coords)(struct sway_view_child *child, int *sx, int *sy); | 186 | void (*get_view_coords)(struct sway_view_child *child, int *sx, int *sy); |
188 | void (*destroy)(struct sway_view_child *child); | 187 | void (*destroy)(struct sway_view_child *child); |
189 | }; | 188 | }; |
190 | 189 | ||
@@ -218,7 +217,7 @@ struct sway_subsurface { | |||
218 | struct sway_xdg_popup { | 217 | struct sway_xdg_popup { |
219 | struct sway_view_child child; | 218 | struct sway_view_child child; |
220 | 219 | ||
221 | struct wlr_xdg_surface *wlr_xdg_surface; | 220 | struct wlr_xdg_popup *wlr_xdg_popup; |
222 | 221 | ||
223 | struct wl_listener new_popup; | 222 | struct wl_listener new_popup; |
224 | struct wl_listener destroy; | 223 | struct wl_listener destroy; |
@@ -311,12 +310,22 @@ void view_destroy(struct sway_view *view); | |||
311 | 310 | ||
312 | void view_begin_destroy(struct sway_view *view); | 311 | void view_begin_destroy(struct sway_view *view); |
313 | 312 | ||
313 | /** | ||
314 | * Map a view, ie. make it visible in the tree. | ||
315 | * | ||
316 | * `fullscreen` should be set to true (and optionally `fullscreen_output` | ||
317 | * should be populated) if the view should be made fullscreen immediately. | ||
318 | * | ||
319 | * `decoration` should be set to true if the client prefers CSD. The client's | ||
320 | * preference may be ignored. | ||
321 | */ | ||
314 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, | 322 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, |
315 | bool fullscreen, struct wlr_output *fullscreen_output, bool decoration); | 323 | bool fullscreen, struct wlr_output *fullscreen_output, bool decoration); |
316 | 324 | ||
317 | void view_unmap(struct sway_view *view); | 325 | void view_unmap(struct sway_view *view); |
318 | 326 | ||
319 | void view_update_size(struct sway_view *view, int width, int height); | 327 | void view_update_size(struct sway_view *view); |
328 | void view_center_surface(struct sway_view *view); | ||
320 | 329 | ||
321 | void view_child_init(struct sway_view_child *child, | 330 | void view_child_init(struct sway_view_child *child, |
322 | const struct sway_view_child_impl *impl, struct sway_view *view, | 331 | const struct sway_view_child_impl *impl, struct sway_view *view, |