aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xdg_shell.c
diff options
context:
space:
mode:
authorLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2018-10-13 21:01:02 +0200
committerLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2018-10-16 15:47:02 +0200
commit892446a0b6eba9d14cdf7462c86565a7a60d12ae (patch)
tree1740c18381767afad7e13703d1cfa7b2e7f013dd /sway/desktop/xdg_shell.c
parentMerge pull request #2817 from trmendes/libinput-disable-touchscreen-support (diff)
downloadsway-892446a0b6eba9d14cdf7462c86565a7a60d12ae.tar.gz
sway-892446a0b6eba9d14cdf7462c86565a7a60d12ae.tar.zst
sway-892446a0b6eba9d14cdf7462c86565a7a60d12ae.zip
view: move arrange_workspace into view_map
For mouse_warping cursor to correctly work on newly spawned containers, the workspace needs to be arranged before the cursor is warped. The shell functions each implement their own fullscreen and arrange checks, move them into the view_map function and pass their states via boolean arguments. Fixes #2819
Diffstat (limited to 'sway/desktop/xdg_shell.c')
-rw-r--r--sway/desktop/xdg_shell.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 46582204..1ed45a6b 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -406,27 +406,19 @@ static void handle_map(struct wl_listener *listener, void *data) {
406 view->natural_height = view->wlr_xdg_surface->surface->current.height; 406 view->natural_height = view->wlr_xdg_surface->surface->current.height;
407 } 407 }
408 408
409 view_map(view, view->wlr_xdg_surface->surface); 409 bool csd = false;
410 410
411 if (!view->xdg_decoration) { 411 if (!view->xdg_decoration) {
412 struct sway_server_decoration *deco = 412 struct sway_server_decoration *deco =
413 decoration_from_surface(xdg_surface->surface); 413 decoration_from_surface(xdg_surface->surface);
414 bool csd = !deco || deco->wlr_server_decoration->mode == 414 csd = !deco || deco->wlr_server_decoration->mode ==
415 WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT; 415 WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT;
416 view_update_csd_from_client(view, csd);
417 }
418 416
419 if (xdg_surface->toplevel->client_pending.fullscreen) {
420 container_set_fullscreen(view->container, true);
421 arrange_workspace(view->container->workspace);
422 } else {
423 if (view->container->parent) {
424 arrange_container(view->container->parent);
425 } else if (view->container->workspace) {
426 arrange_workspace(view->container->workspace);
427 }
428 } 417 }
429 418
419 view_map(view, view->wlr_xdg_surface->surface,
420 xdg_surface->toplevel->client_pending.fullscreen, csd);
421
430 transaction_commit_dirty(); 422 transaction_commit_dirty();
431 423
432 xdg_shell_view->commit.notify = handle_commit; 424 xdg_shell_view->commit.notify = handle_commit;