diff options
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/view.c | 16 |
1 files changed, 14 insertions, 2 deletions
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) { } void view_map(struct sway_view *view, struct wlr_surface *wlr_surface, - bool fullscreen, bool decoration) { + bool fullscreen, struct wlr_output *fullscreen_output, + bool decoration) { if (!sway_assert(view->surface == NULL, "cannot map mapped view")) { return; } view->surface = wlr_surface; + // If there is a request to be opened fullscreen on a specific output, try + // to honor that request. Otherwise, fallback to assigns, pid mappings, + // focused workspace, etc + struct sway_workspace *ws = NULL; + if (fullscreen_output && fullscreen_output->data) { + struct sway_output *output = fullscreen_output->data; + ws = output_get_active_workspace(output); + } + if (!ws) { + ws = select_workspace(view); + } + struct sway_seat *seat = input_manager_current_seat(); - struct sway_workspace *ws = select_workspace(view); struct sway_node *node = seat_get_focus_inactive(seat, &ws->node); struct sway_container *target_sibling = node->type == N_CONTAINER ? node->sway_container : NULL; |