aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-03 16:35:06 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-09 10:08:43 +1000
commit59c94887018bdfa578c4371c4275061ca6e71b3e (patch)
tree62bdaa6ac4777d1fcb292013bddd2043dad7765a /sway/desktop/xwayland.c
parentMerge pull request #2115 from RedSoxFan/restore-workspaces (diff)
downloadsway-59c94887018bdfa578c4371c4275061ca6e71b3e.tar.gz
sway-59c94887018bdfa578c4371c4275061ca6e71b3e.tar.zst
sway-59c94887018bdfa578c4371c4275061ca6e71b3e.zip
WIP: Atomic layout updates ground work
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 6447b711..6a3c1b66 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -167,19 +167,18 @@ static uint32_t get_int_prop(struct sway_view *view, enum sway_view_prop prop) {
167 } 167 }
168} 168}
169 169
170static void configure(struct sway_view *view, double lx, double ly, int width, 170static uint32_t configure(struct sway_view *view, double lx, double ly, int width,
171 int height) { 171 int height) {
172 struct sway_xwayland_view *xwayland_view = xwayland_view_from_view(view); 172 struct sway_xwayland_view *xwayland_view = xwayland_view_from_view(view);
173 if (xwayland_view == NULL) { 173 if (xwayland_view == NULL) {
174 return; 174 return 0;
175 } 175 }
176 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; 176 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
177 177
178 xwayland_view->pending_lx = lx;
179 xwayland_view->pending_ly = ly;
180 xwayland_view->pending_width = width;
181 xwayland_view->pending_height = height;
182 wlr_xwayland_surface_configure(xsurface, lx, ly, width, height); 178 wlr_xwayland_surface_configure(xsurface, lx, ly, width, height);
179
180 // xwayland doesn't give us a serial for the configure
181 return 0;
183} 182}
184 183
185static void set_activated(struct sway_view *view, bool activated) { 184static void set_activated(struct sway_view *view, bool activated) {
@@ -250,15 +249,21 @@ static void handle_commit(struct wl_listener *listener, void *data) {
250 wl_container_of(listener, xwayland_view, commit); 249 wl_container_of(listener, xwayland_view, commit);
251 struct sway_view *view = &xwayland_view->view; 250 struct sway_view *view = &xwayland_view->view;
252 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; 251 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
253 if (view->swayc && container_is_floating(view->swayc)) { 252
254 view_update_size(view, xsurface->width, xsurface->height); 253 // Don't allow xwayland views to do resize or reposition themselves if
255 } else { 254 // they're involved in a transaction. Once the transaction has finished
256 view_update_size(view, xwayland_view->pending_width, 255 // they'll apply the next time a commit happens.
257 xwayland_view->pending_height); 256 if (view->instructions->length) {
257 if (view->swayc && container_is_floating(view->swayc)) {
258 view_update_size(view, xsurface->width, xsurface->height);
259 } else {
260 view_update_size(view, view->swayc->pending.swayc_width,
261 view->swayc->pending.swayc_height);
262 }
263 view_update_position(view,
264 view->swayc->pending.view_x, view->swayc->pending.view_y);
265 view_damage_from(view);
258 } 266 }
259 view_update_position(view,
260 xwayland_view->pending_lx, xwayland_view->pending_ly);
261 view_damage_from(view);
262} 267}
263 268
264static void handle_unmap(struct wl_listener *listener, void *data) { 269static void handle_unmap(struct wl_listener *listener, void *data) {