diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-24 23:01:09 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-24 23:01:09 +1000 |
commit | 1549fb719ae75a498bf319db45281464e72c759e (patch) | |
tree | e5944487928a65b1af3b7dc9a44f1b14250bc0bf /sway/desktop/xwayland.c | |
parent | Fix crash when running move <direction> in an empty workspace (diff) | |
download | sway-1549fb719ae75a498bf319db45281464e72c759e.tar.gz sway-1549fb719ae75a498bf319db45281464e72c759e.tar.zst sway-1549fb719ae75a498bf319db45281464e72c759e.zip |
Implement atomic layout updates for xwayland views
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index a1837420..7e78ef32 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <wlr/xwayland.h> | 7 | #include <wlr/xwayland.h> |
8 | #include "log.h" | 8 | #include "log.h" |
9 | #include "sway/desktop.h" | 9 | #include "sway/desktop.h" |
10 | #include "sway/desktop/transaction.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/output.h" | 13 | #include "sway/output.h" |
@@ -243,16 +244,9 @@ static void handle_commit(struct wl_listener *listener, void *data) { | |||
243 | struct sway_view *view = &xwayland_view->view; | 244 | struct sway_view *view = &xwayland_view->view; |
244 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; | 245 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; |
245 | 246 | ||
246 | // Don't allow xwayland views to do resize or reposition themselves if | 247 | if (view->swayc->instructions->length) { |
247 | // they're involved in a transaction. Once the transaction has finished | 248 | transaction_notify_view_ready_by_size(view, |
248 | // they'll apply the next time a commit happens. | 249 | xsurface->width, xsurface->height); |
249 | if (view->swayc && view->swayc->instructions->length) { | ||
250 | if (view->swayc && container_is_floating(view->swayc)) { | ||
251 | view_update_size(view, xsurface->width, xsurface->height); | ||
252 | } else { | ||
253 | view_update_size(view, view->swayc->width, view->swayc->height); | ||
254 | } | ||
255 | view_update_position(view, view->x, view->y); | ||
256 | } | 250 | } |
257 | view_damage_from(view); | 251 | view_damage_from(view); |
258 | } | 252 | } |