aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-05-30 10:22:35 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-01 23:14:58 +1000
commit9119f876552a47716bd317524bf5d786f909e5e5 (patch)
tree43c14f317a4e971e0f76cbbaf446a91179505cc2 /sway/desktop/xwayland.c
parentAdjust move command to account for changed coordinate system (diff)
downloadsway-9119f876552a47716bd317524bf5d786f909e5e5.tar.gz
sway-9119f876552a47716bd317524bf5d786f909e5e5.tar.zst
sway-9119f876552a47716bd317524bf5d786f909e5e5.zip
Fix floating position when view is floated when mapped
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index d0fbcaeb..76265ea9 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -235,10 +235,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
235 wl_container_of(listener, xwayland_view, commit); 235 wl_container_of(listener, xwayland_view, commit);
236 struct sway_view *view = &xwayland_view->view; 236 struct sway_view *view = &xwayland_view->view;
237 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; 237 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
238 if (!view->natural_width && !view->natural_height) {
239 view->natural_width = xsurface->width;
240 view->natural_height = xsurface->height;
241 }
242 if (view->swayc && container_is_floating(view->swayc)) { 238 if (view->swayc && container_is_floating(view->swayc)) {
243 view_update_size(view, xsurface->width, xsurface->height); 239 view_update_size(view, xsurface->width, xsurface->height);
244 view_update_position(view, 240 view_update_position(view,
@@ -263,6 +259,9 @@ static void handle_map(struct wl_listener *listener, void *data) {
263 struct wlr_xwayland_surface *xsurface = data; 259 struct wlr_xwayland_surface *xsurface = data;
264 struct sway_view *view = &xwayland_view->view; 260 struct sway_view *view = &xwayland_view->view;
265 261
262 view->natural_width = xsurface->width;
263 view->natural_height = xsurface->height;
264
266 // Wire up the commit listener here, because xwayland map/unmap can change 265 // Wire up the commit listener here, because xwayland map/unmap can change
267 // the underlying wlr_surface 266 // the underlying wlr_surface
268 wl_signal_add(&xsurface->surface->events.commit, &xwayland_view->commit); 267 wl_signal_add(&xsurface->surface->events.commit, &xwayland_view->commit);