summaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 5b3c7b2b..277c53a3 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -6,6 +6,7 @@
6#include <wlr/types/wlr_xdg_shell_v6.h> 6#include <wlr/types/wlr_xdg_shell_v6.h>
7#include "log.h" 7#include "log.h"
8#include "sway/decoration.h" 8#include "sway/decoration.h"
9#include "sway/desktop.h"
9#include "sway/input/input-manager.h" 10#include "sway/input/input-manager.h"
10#include "sway/input/seat.h" 11#include "sway/input/seat.h"
11#include "sway/server.h" 12#include "sway/server.h"
@@ -106,7 +107,8 @@ static void get_constraints(struct sway_view *view, double *min_width,
106 *max_height = state->max_height > 0 ? state->max_height : DBL_MAX; 107 *max_height = state->max_height > 0 ? state->max_height : DBL_MAX;
107} 108}
108 109
109static const char *get_string_prop(struct sway_view *view, enum sway_view_prop prop) { 110static const char *get_string_prop(struct sway_view *view,
111 enum sway_view_prop prop) {
110 if (xdg_shell_v6_view_from_view(view) == NULL) { 112 if (xdg_shell_v6_view_from_view(view) == NULL) {
111 return NULL; 113 return NULL;
112 } 114 }
@@ -250,9 +252,26 @@ static void handle_commit(struct wl_listener *listener, void *data) {
250 if (!view->swayc) { 252 if (!view->swayc) {
251 return; 253 return;
252 } 254 }
255
253 if (view->swayc->instruction) { 256 if (view->swayc->instruction) {
257 wlr_xdg_surface_v6_get_geometry(xdg_surface_v6, &view->geometry);
254 transaction_notify_view_ready_by_serial(view, 258 transaction_notify_view_ready_by_serial(view,
255 xdg_surface_v6->configure_serial); 259 xdg_surface_v6->configure_serial);
260 } else {
261 struct wlr_box new_geo;
262 wlr_xdg_surface_v6_get_geometry(xdg_surface_v6, &new_geo);
263
264 if ((new_geo.width != view->width || new_geo.height != view->height) &&
265 container_is_floating(view->swayc)) {
266 // A floating view has unexpectedly sent a new size
267 desktop_damage_view(view);
268 view_update_size(view, new_geo.width, new_geo.height);
269 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
270 desktop_damage_view(view);
271 transaction_commit_dirty();
272 } else {
273 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
274 }
256 } 275 }
257 276
258 view_damage_from(view); 277 view_damage_from(view);