diff options
author | emersion <contact@emersion.fr> | 2018-09-02 21:41:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-02 21:41:24 +0200 |
commit | e438342157272f6a807ea28ef1b554e01530ead8 (patch) | |
tree | fb510fe69ef12a9de9d299fa1543c32b49a16e8e /sway/tree | |
parent | 159edc6d13db42b15b28c7ea58cdf2371d29297d (diff) | |
parent | 6fb03817c9d2bd29697a91f92d680b0c6a2c5996 (diff) |
Merge pull request #2560 from RyanDwyer/focus-on-window-activation
Implement focus_on_window_activation
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/view.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 1a98c5f2..6bd0ef67 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -280,6 +280,29 @@ void view_set_activated(struct sway_view *view, bool activated) { } } +void view_request_activate(struct sway_view *view) { + struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); + struct sway_seat *seat = input_manager_current_seat(input_manager); + + switch (config->focus_on_window_activation) { + case FOWA_SMART: + if (workspace_is_visible(ws)) { + seat_set_focus(seat, view->swayc); + } else { + view_set_urgent(view, true); + } + break; + case FOWA_URGENT: + view_set_urgent(view, true); + break; + case FOWA_FOCUS: + seat_set_focus(seat, view->swayc); + break; + case FOWA_NONE: + break; + } +} + void view_set_tiled(struct sway_view *view, bool tiled) { if (!tiled) { view->using_csd = true; |