diff options
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/view.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index fcb78de3..ec54fed8 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -369,16 +369,13 @@ void view_set_activated(struct sway_view *view, bool activated) { | |||
369 | 369 | ||
370 | void view_request_activate(struct sway_view *view, struct sway_seat *seat) { | 370 | void view_request_activate(struct sway_view *view, struct sway_seat *seat) { |
371 | struct sway_workspace *ws = view->container->pending.workspace; | 371 | struct sway_workspace *ws = view->container->pending.workspace; |
372 | if (!ws) { // hidden scratchpad container | ||
373 | return; | ||
374 | } | ||
375 | if (!seat) { | 372 | if (!seat) { |
376 | seat = input_manager_current_seat(); | 373 | seat = input_manager_current_seat(); |
377 | } | 374 | } |
378 | 375 | ||
379 | switch (config->focus_on_window_activation) { | 376 | switch (config->focus_on_window_activation) { |
380 | case FOWA_SMART: | 377 | case FOWA_SMART: |
381 | if (workspace_is_visible(ws)) { | 378 | if (ws && workspace_is_visible(ws)) { |
382 | seat_set_focus_container(seat, view->container); | 379 | seat_set_focus_container(seat, view->container); |
383 | container_raise_floating(view->container); | 380 | container_raise_floating(view->container); |
384 | } else { | 381 | } else { |
@@ -389,8 +386,12 @@ void view_request_activate(struct sway_view *view, struct sway_seat *seat) { | |||
389 | view_set_urgent(view, true); | 386 | view_set_urgent(view, true); |
390 | break; | 387 | break; |
391 | case FOWA_FOCUS: | 388 | case FOWA_FOCUS: |
392 | seat_set_focus_container(seat, view->container); | 389 | if (container_is_scratchpad_hidden_or_child(view->container)) { |
393 | container_raise_floating(view->container); | 390 | root_scratchpad_show(view->container); |
391 | } else { | ||
392 | seat_set_focus_container(seat, view->container); | ||
393 | container_raise_floating(view->container); | ||
394 | } | ||
394 | break; | 395 | break; |
395 | case FOWA_NONE: | 396 | case FOWA_NONE: |
396 | break; | 397 | break; |