aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 667fb9e5..d34654fd 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -70,13 +70,13 @@ static void popup_unconstrain(struct sway_xdg_popup *popup) {
70 struct sway_view *view = popup->child.view; 70 struct sway_view *view = popup->child.view;
71 struct wlr_xdg_popup *wlr_popup = popup->wlr_xdg_surface->popup; 71 struct wlr_xdg_popup *wlr_popup = popup->wlr_xdg_surface->popup;
72 72
73 struct sway_output *output = view->container->workspace->output; 73 struct sway_output *output = view->container->pending.workspace->output;
74 74
75 // the output box expressed in the coordinate system of the toplevel parent 75 // the output box expressed in the coordinate system of the toplevel parent
76 // of the popup 76 // of the popup
77 struct wlr_box output_toplevel_sx_box = { 77 struct wlr_box output_toplevel_sx_box = {
78 .x = output->lx - view->container->content_x, 78 .x = output->lx - view->container->pending.content_x,
79 .y = output->ly - view->container->content_y, 79 .y = output->ly - view->container->pending.content_y,
80 .width = output->width, 80 .width = output->width,
81 .height = output->height, 81 .height = output->height,
82 }; 82 };
@@ -293,19 +293,23 @@ static void handle_commit(struct wl_listener *listener, void *data) {
293 new_geo.y != view->geometry.y; 293 new_geo.y != view->geometry.y;
294 294
295 if (new_size) { 295 if (new_size) {
296 // The view has unexpectedly sent a new size 296 // The client changed its surface size in this commit. For floating
297 // containers, we resize the container to match. For tiling containers,
298 // we only recenter the surface.
297 desktop_damage_view(view); 299 desktop_damage_view(view);
298 view_update_size(view, new_geo.width, new_geo.height);
299 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box)); 300 memcpy(&view->geometry, &new_geo, sizeof(struct wlr_box));
301 if (container_is_floating(view->container)) {
302 view_update_size(view);
303 transaction_commit_dirty_client();
304 } else {
305 view_center_surface(view);
306 }
300 desktop_damage_view(view); 307 desktop_damage_view(view);
301 transaction_commit_dirty();
302 } 308 }
303 309
304 if (view->container->node.instruction) { 310 if (view->container->node.instruction) {
305 transaction_notify_view_ready_by_serial(view, 311 transaction_notify_view_ready_by_serial(view,
306 xdg_surface->configure_serial); 312 xdg_surface->configure_serial);
307 } else if (new_size) {
308 transaction_notify_view_ready_immediately(view);
309 } 313 }
310 314
311 view_damage_from(view); 315 view_damage_from(view);
@@ -354,7 +358,8 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data)
354 if (e->fullscreen && e->output && e->output->data) { 358 if (e->fullscreen && e->output && e->output->data) {
355 struct sway_output *output = e->output->data; 359 struct sway_output *output = e->output->data;
356 struct sway_workspace *ws = output_get_active_workspace(output); 360 struct sway_workspace *ws = output_get_active_workspace(output);
357 if (ws && !container_is_scratchpad_hidden(container)) { 361 if (ws && !container_is_scratchpad_hidden(container) &&
362 container->pending.workspace != ws) {
358 if (container_is_floating(container)) { 363 if (container_is_floating(container)) {
359 workspace_add_floating(ws, container); 364 workspace_add_floating(ws, container);
360 } else { 365 } else {