diff options
-rw-r--r-- | sway/desktop/xwayland.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 183bdba2..0967c7fc 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -414,17 +414,6 @@ static const struct sway_view_impl view_impl = { | |||
414 | .destroy = destroy, | 414 | .destroy = destroy, |
415 | }; | 415 | }; |
416 | 416 | ||
417 | static void get_geometry(struct sway_view *view, struct wlr_box *box) { | ||
418 | box->x = box->y = 0; | ||
419 | if (view->surface) { | ||
420 | box->width = view->surface->current.width; | ||
421 | box->height = view->surface->current.height; | ||
422 | } else { | ||
423 | box->width = 0; | ||
424 | box->height = 0; | ||
425 | } | ||
426 | } | ||
427 | |||
428 | static void handle_commit(struct wl_listener *listener, void *data) { | 417 | static void handle_commit(struct wl_listener *listener, void *data) { |
429 | struct sway_xwayland_view *xwayland_view = | 418 | struct sway_xwayland_view *xwayland_view = |
430 | wl_container_of(listener, xwayland_view, commit); | 419 | wl_container_of(listener, xwayland_view, commit); |
@@ -432,12 +421,12 @@ static void handle_commit(struct wl_listener *listener, void *data) { | |||
432 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; | 421 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; |
433 | struct wlr_surface_state *state = &xsurface->surface->current; | 422 | struct wlr_surface_state *state = &xsurface->surface->current; |
434 | 423 | ||
435 | struct wlr_box new_geo; | 424 | struct wlr_box new_geo = {0}; |
436 | get_geometry(view, &new_geo); | 425 | new_geo.width = state->width; |
426 | new_geo.height = state->height; | ||
427 | |||
437 | bool new_size = new_geo.width != view->geometry.width || | 428 | bool new_size = new_geo.width != view->geometry.width || |
438 | new_geo.height != view->geometry.height || | 429 | new_geo.height != view->geometry.height; |
439 | new_geo.x != view->geometry.x || | ||
440 | new_geo.y != view->geometry.y; | ||
441 | 430 | ||
442 | if (new_size) { | 431 | if (new_size) { |
443 | // The client changed its surface size in this commit. For floating | 432 | // The client changed its surface size in this commit. For floating |