aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-08-19 16:07:11 +1000
committerGitHub <noreply@github.com>2018-08-19 16:07:11 +1000
commit7f22fab3895ff090d5e26936f4e964e081090164 (patch)
treec5d96041e3270b1d1d50f8a42d91652d615c9938 /sway/desktop/xdg_shell.c
parent37e37627cae0a23d9f763cc56378b528f2ff3885 (diff)
parentd0a24465d75cc7197ee253e1de9fa961071cd034 (diff)
Merge branch 'master' into commands
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c20
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 @@
#include <wlr/util/edges.h>
#include "log.h"
#include "sway/decoration.h"
+#include "sway/desktop.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
#include "sway/server.h"
@@ -107,7 +108,8 @@ static void get_constraints(struct sway_view *view, double *min_width,
*max_height = state->max_height > 0 ? state->max_height : DBL_MAX;
}
-static const char *get_string_prop(struct sway_view *view, enum sway_view_prop prop) {
+static const char *get_string_prop(struct sway_view *view,
+ enum sway_view_prop prop) {
if (xdg_shell_view_from_view(view) == NULL) {
return NULL;
}
@@ -255,8 +257,24 @@ static void handle_commit(struct wl_listener *listener, void *data) {
}
if (view->swayc->instruction) {
+ wlr_xdg_surface_get_geometry(xdg_surface, &view->geometry);
transaction_notify_view_ready_by_serial(view,
xdg_surface->configure_serial);
+ } else {
+ struct wlr_box new_geo;
+ wlr_xdg_surface_get_geometry(xdg_surface, &new_geo);
+
+ if ((new_geo.width != view->width || new_geo.height != view->height) &&
+ container_is_floating(view->swayc)) {
+ // A floating view has unexpectedly sent a new size
+ desktop_damage_view(view);
+ view_update_size(view, new_geo.width, new_geo.height);
+ memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
+ desktop_damage_view(view);
+ transaction_commit_dirty();
+ } else {
+ memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
+ }
}
view_damage_from(view);