aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/view.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/tree/view.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/tree/view.c')
-rw-r--r--sway/tree/view.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index e613ac0b..bdd5f830 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -535,7 +535,8 @@ static bool should_focus(struct sway_view *view) {
535 return len == 0; 535 return len == 0;
536} 536}
537 537
538void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) { 538void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
539 bool fullscreen, bool decoration) {
539 if (!sway_assert(view->surface == NULL, "cannot map mapped view")) { 540 if (!sway_assert(view->surface == NULL, "cannot map mapped view")) {
540 return; 541 return;
541 } 542 }
@@ -586,13 +587,28 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) {
586 } 587 }
587 } 588 }
588 589
589 if (should_focus(view)) {
590 input_manager_set_focus(input_manager, &view->container->node);
591 }
592
593 view_update_title(view, false); 590 view_update_title(view, false);
594 container_update_representation(view->container); 591 container_update_representation(view->container);
595 view_execute_criteria(view); 592 view_execute_criteria(view);
593
594 if (decoration) {
595 view_update_csd_from_client(view, decoration);
596 }
597
598 if (fullscreen) {
599 container_set_fullscreen(view->container, true);
600 arrange_workspace(view->container->workspace);
601 } else {
602 if (view->container->parent) {
603 arrange_container(view->container->parent);
604 } else if (view->container->workspace) {
605 arrange_workspace(view->container->workspace);
606 }
607 }
608
609 if (should_focus(view)) {
610 input_manager_set_focus(input_manager, &view->container->node);
611 }
596} 612}
597 613
598void view_unmap(struct sway_view *view) { 614void view_unmap(struct sway_view *view) {