diff options
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r-- | sway/desktop/xdg_shell.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index 6a7a3f7f..aae129bd 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <wlr/util/edges.h> | 7 | #include <wlr/util/edges.h> |
8 | #include "log.h" | 8 | #include "log.h" |
9 | #include "sway/decoration.h" | 9 | #include "sway/decoration.h" |
10 | #include "sway/desktop.h" | ||
10 | #include "sway/input/input-manager.h" | 11 | #include "sway/input/input-manager.h" |
11 | #include "sway/input/seat.h" | 12 | #include "sway/input/seat.h" |
12 | #include "sway/server.h" | 13 | #include "sway/server.h" |
@@ -107,7 +108,8 @@ static void get_constraints(struct sway_view *view, double *min_width, | |||
107 | *max_height = state->max_height > 0 ? state->max_height : DBL_MAX; | 108 | *max_height = state->max_height > 0 ? state->max_height : DBL_MAX; |
108 | } | 109 | } |
109 | 110 | ||
110 | static const char *get_string_prop(struct sway_view *view, enum sway_view_prop prop) { | 111 | static const char *get_string_prop(struct sway_view *view, |
112 | enum sway_view_prop prop) { | ||
111 | if (xdg_shell_view_from_view(view) == NULL) { | 113 | if (xdg_shell_view_from_view(view) == NULL) { |
112 | return NULL; | 114 | return NULL; |
113 | } | 115 | } |
@@ -255,8 +257,24 @@ static void handle_commit(struct wl_listener *listener, void *data) { | |||
255 | } | 257 | } |
256 | 258 | ||
257 | if (view->swayc->instruction) { | 259 | if (view->swayc->instruction) { |
260 | wlr_xdg_surface_get_geometry(xdg_surface, &view->geometry); | ||
258 | transaction_notify_view_ready_by_serial(view, | 261 | transaction_notify_view_ready_by_serial(view, |
259 | xdg_surface->configure_serial); | 262 | xdg_surface->configure_serial); |
263 | } else { | ||
264 | struct wlr_box new_geo; | ||
265 | wlr_xdg_surface_get_geometry(xdg_surface, &new_geo); | ||
266 | |||
267 | if ((new_geo.width != view->width || new_geo.height != view->height) && | ||
268 | container_is_floating(view->swayc)) { | ||
269 | // A floating view has unexpectedly sent a new size | ||
270 | desktop_damage_view(view); | ||
271 | view_update_size(view, new_geo.width, new_geo.height); | ||
272 | memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); | ||
273 | desktop_damage_view(view); | ||
274 | transaction_commit_dirty(); | ||
275 | } else { | ||
276 | memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); | ||
277 | } | ||
260 | } | 278 | } |
261 | 279 | ||
262 | view_damage_from(view); | 280 | view_damage_from(view); |