diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-02 15:03:58 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-09-02 18:20:34 +1000 |
commit | f057a0195ee79dfcaeddbcab026c06e310998c75 (patch) | |
tree | 5c09cc286ae3a6d852341a0ae4796d28bb6155b0 /sway/tree/view.c | |
parent | Merge pull request #2559 from RyanDwyer/xwayland-check-modal (diff) | |
download | sway-f057a0195ee79dfcaeddbcab026c06e310998c75.tar.gz sway-f057a0195ee79dfcaeddbcab026c06e310998c75.tar.zst sway-f057a0195ee79dfcaeddbcab026c06e310998c75.zip |
Implement focus_on_window_activation
Depends on https://github.com/swaywm/wlroots/pull/1223
Diffstat (limited to 'sway/tree/view.c')
-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..c6ed68f6 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) { | |||
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
283 | void view_request_activate(struct sway_view *view) { | ||
284 | if (config->focus_on_window_activation == FOWA_NONE) { | ||
285 | return; | ||
286 | } | ||
287 | if (config->focus_on_window_activation == FOWA_FOCUS) { | ||
288 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
289 | seat_set_focus(seat, view->swayc); | ||
290 | return; | ||
291 | } | ||
292 | if (config->focus_on_window_activation == FOWA_URGENT) { | ||
293 | view_set_urgent(view, true); | ||
294 | return; | ||
295 | } | ||
296 | // FOWA_SMART | ||
297 | struct sway_container *ws = container_parent(view->swayc, C_WORKSPACE); | ||
298 | if (workspace_is_visible(ws)) { | ||
299 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
300 | seat_set_focus(seat, view->swayc); | ||
301 | } else { | ||
302 | view_set_urgent(view, true); | ||
303 | } | ||
304 | } | ||
305 | |||
283 | void view_set_tiled(struct sway_view *view, bool tiled) { | 306 | void view_set_tiled(struct sway_view *view, bool tiled) { |
284 | if (!tiled) { | 307 | if (!tiled) { |
285 | view->using_csd = true; | 308 | view->using_csd = true; |