diff options
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 6ffe334a..bce59174 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <wayland-server.h> | 4 | #include <wayland-server.h> |
5 | #include <wlr/types/wlr_xdg_shell_v6.h> | 5 | #include <wlr/types/wlr_xdg_shell_v6.h> |
6 | #include "sway/desktop/transaction.h" | ||
6 | #include "sway/tree/container.h" | 7 | #include "sway/tree/container.h" |
7 | #include "sway/tree/layout.h" | 8 | #include "sway/tree/layout.h" |
8 | #include "sway/server.h" | 9 | #include "sway/server.h" |
@@ -86,18 +87,15 @@ static const char *get_string_prop(struct sway_view *view, enum sway_view_prop p | |||
86 | } | 87 | } |
87 | } | 88 | } |
88 | 89 | ||
89 | static void configure(struct sway_view *view, double lx, double ly, int width, | 90 | static uint32_t configure(struct sway_view *view, double lx, double ly, |
90 | int height) { | 91 | int width, int height) { |
91 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = | 92 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = |
92 | xdg_shell_v6_view_from_view(view); | 93 | xdg_shell_v6_view_from_view(view); |
93 | if (xdg_shell_v6_view == NULL) { | 94 | if (xdg_shell_v6_view == NULL) { |
94 | return; | 95 | return 0; |
95 | } | 96 | } |
96 | 97 | return wlr_xdg_toplevel_v6_set_size( | |
97 | xdg_shell_v6_view->pending_width = width; | 98 | view->wlr_xdg_surface_v6, width, height); |
98 | xdg_shell_v6_view->pending_height = height; | ||
99 | wlr_xdg_toplevel_v6_set_size(view->wlr_xdg_surface_v6, width, height); | ||
100 | view_update_position(view, lx, ly); | ||
101 | } | 99 | } |
102 | 100 | ||
103 | static void set_activated(struct sway_view *view, bool activated) { | 101 | static void set_activated(struct sway_view *view, bool activated) { |
@@ -173,18 +171,12 @@ static void handle_commit(struct wl_listener *listener, void *data) { | |||
173 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = | 171 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = |
174 | wl_container_of(listener, xdg_shell_v6_view, commit); | 172 | wl_container_of(listener, xdg_shell_v6_view, commit); |
175 | struct sway_view *view = &xdg_shell_v6_view->view; | 173 | struct sway_view *view = &xdg_shell_v6_view->view; |
176 | if (view->swayc && container_is_floating(view->swayc)) { | 174 | struct wlr_xdg_surface_v6 *xdg_surface_v6 = view->wlr_xdg_surface_v6; |
177 | int width = view->wlr_xdg_surface_v6->geometry.width; | 175 | |
178 | int height = view->wlr_xdg_surface_v6->geometry.height; | 176 | if (view->instructions->length) { |
179 | if (!width && !height) { | 177 | transaction_notify_view_ready(view, xdg_surface_v6->configure_serial); |
180 | width = view->wlr_xdg_surface_v6->surface->current->width; | ||
181 | height = view->wlr_xdg_surface_v6->surface->current->height; | ||
182 | } | ||
183 | view_update_size(view, width, height); | ||
184 | } else { | ||
185 | view_update_size(view, xdg_shell_v6_view->pending_width, | ||
186 | xdg_shell_v6_view->pending_height); | ||
187 | } | 178 | } |
179 | |||
188 | view_update_title(view, false); | 180 | view_update_title(view, false); |
189 | view_damage_from(view); | 181 | view_damage_from(view); |
190 | } | 182 | } |