diff options
-rw-r--r-- | include/sway/tree/view.h | 2 | ||||
-rw-r--r-- | sway/desktop/xdg_shell.c | 16 | ||||
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 16 | ||||
-rw-r--r-- | sway/desktop/xwayland.c | 2 | ||||
-rw-r--r-- | sway/tree/view.c | 16 |
5 files changed, 46 insertions, 6 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index ac203ac7..bdd8960c 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -314,7 +314,7 @@ void view_destroy(struct sway_view *view); | |||
314 | void view_begin_destroy(struct sway_view *view); | 314 | void view_begin_destroy(struct sway_view *view); |
315 | 315 | ||
316 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, | 316 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, |
317 | bool fullscreen, bool decoration); | 317 | bool fullscreen, struct wlr_output *fullscreen_output, bool decoration); |
318 | 318 | ||
319 | void view_unmap(struct sway_view *view); | 319 | void view_unmap(struct sway_view *view); |
320 | 320 | ||
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c index ea5dcd16..9e914f14 100644 --- a/sway/desktop/xdg_shell.c +++ b/sway/desktop/xdg_shell.c | |||
@@ -339,6 +339,18 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | 341 | ||
342 | if (e->fullscreen && e->output && e->output->data) { | ||
343 | struct sway_output *output = e->output->data; | ||
344 | struct sway_workspace *ws = output_get_active_workspace(output); | ||
345 | if (ws && !container_is_scratchpad_hidden(view->container)) { | ||
346 | if (container_is_floating(view->container)) { | ||
347 | workspace_add_floating(ws, view->container); | ||
348 | } else { | ||
349 | workspace_add_tiling(ws, view->container); | ||
350 | } | ||
351 | } | ||
352 | } | ||
353 | |||
342 | container_set_fullscreen(view->container, e->fullscreen); | 354 | container_set_fullscreen(view->container, e->fullscreen); |
343 | 355 | ||
344 | arrange_root(); | 356 | arrange_root(); |
@@ -417,7 +429,9 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
417 | } | 429 | } |
418 | 430 | ||
419 | view_map(view, view->wlr_xdg_surface->surface, | 431 | view_map(view, view->wlr_xdg_surface->surface, |
420 | xdg_surface->toplevel->client_pending.fullscreen, csd); | 432 | xdg_surface->toplevel->client_pending.fullscreen, |
433 | xdg_surface->toplevel->client_pending.fullscreen_output, | ||
434 | csd); | ||
421 | 435 | ||
422 | transaction_commit_dirty(); | 436 | transaction_commit_dirty(); |
423 | 437 | ||
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 7ff4c4de..5ac589cf 100644 --- a/sway/desktop/xdg_shell_v6.c +++ b/sway/desktop/xdg_shell_v6.c | |||
@@ -339,6 +339,18 @@ static void handle_request_fullscreen(struct wl_listener *listener, void *data) | |||
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | 341 | ||
342 | if (e->fullscreen && e->output && e->output->data) { | ||
343 | struct sway_output *output = e->output->data; | ||
344 | struct sway_workspace *ws = output_get_active_workspace(output); | ||
345 | if (ws && !container_is_scratchpad_hidden(view->container)) { | ||
346 | if (container_is_floating(view->container)) { | ||
347 | workspace_add_floating(ws, view->container); | ||
348 | } else { | ||
349 | workspace_add_tiling(ws, view->container); | ||
350 | } | ||
351 | } | ||
352 | } | ||
353 | |||
342 | container_set_fullscreen(view->container, e->fullscreen); | 354 | container_set_fullscreen(view->container, e->fullscreen); |
343 | 355 | ||
344 | arrange_root(); | 356 | arrange_root(); |
@@ -411,7 +423,9 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
411 | == WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT; | 423 | == WLR_SERVER_DECORATION_MANAGER_MODE_CLIENT; |
412 | 424 | ||
413 | view_map(view, view->wlr_xdg_surface_v6->surface, | 425 | view_map(view, view->wlr_xdg_surface_v6->surface, |
414 | xdg_surface->toplevel->client_pending.fullscreen, csd); | 426 | xdg_surface->toplevel->client_pending.fullscreen, |
427 | xdg_surface->toplevel->client_pending.fullscreen_output, | ||
428 | csd); | ||
415 | 429 | ||
416 | transaction_commit_dirty(); | 430 | transaction_commit_dirty(); |
417 | 431 | ||
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 37d0b986..f6ca8f81 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -415,7 +415,7 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
415 | xwayland_view->commit.notify = handle_commit; | 415 | xwayland_view->commit.notify = handle_commit; |
416 | 416 | ||
417 | // Put it back into the tree | 417 | // Put it back into the tree |
418 | view_map(view, xsurface->surface, xsurface->fullscreen, false); | 418 | view_map(view, xsurface->surface, xsurface->fullscreen, NULL, false); |
419 | 419 | ||
420 | transaction_commit_dirty(); | 420 | transaction_commit_dirty(); |
421 | } | 421 | } |
diff --git a/sway/tree/view.c b/sway/tree/view.c index 4759c998..2c8839f5 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -561,14 +561,26 @@ static bool should_focus(struct sway_view *view) { | |||
561 | } | 561 | } |
562 | 562 | ||
563 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, | 563 | void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, |
564 | bool fullscreen, bool decoration) { | 564 | bool fullscreen, struct wlr_output *fullscreen_output, |
565 | bool decoration) { | ||
565 | if (!sway_assert(view->surface == NULL, "cannot map mapped view")) { | 566 | if (!sway_assert(view->surface == NULL, "cannot map mapped view")) { |
566 | return; | 567 | return; |
567 | } | 568 | } |
568 | view->surface = wlr_surface; | 569 | view->surface = wlr_surface; |
569 | 570 | ||
571 | // If there is a request to be opened fullscreen on a specific output, try | ||
572 | // to honor that request. Otherwise, fallback to assigns, pid mappings, | ||
573 | // focused workspace, etc | ||
574 | struct sway_workspace *ws = NULL; | ||
575 | if (fullscreen_output && fullscreen_output->data) { | ||
576 | struct sway_output *output = fullscreen_output->data; | ||
577 | ws = output_get_active_workspace(output); | ||
578 | } | ||
579 | if (!ws) { | ||
580 | ws = select_workspace(view); | ||
581 | } | ||
582 | |||
570 | struct sway_seat *seat = input_manager_current_seat(); | 583 | struct sway_seat *seat = input_manager_current_seat(); |
571 | struct sway_workspace *ws = select_workspace(view); | ||
572 | struct sway_node *node = seat_get_focus_inactive(seat, &ws->node); | 584 | struct sway_node *node = seat_get_focus_inactive(seat, &ws->node); |
573 | struct sway_container *target_sibling = node->type == N_CONTAINER ? | 585 | struct sway_container *target_sibling = node->type == N_CONTAINER ? |
574 | node->sway_container : NULL; | 586 | node->sway_container : NULL; |