diff options
author | 2018-09-02 15:03:58 +1000 | |
---|---|---|
committer | 2018-09-02 18:20:34 +1000 | |
commit | f057a0195ee79dfcaeddbcab026c06e310998c75 (patch) | |
tree | 5c09cc286ae3a6d852341a0ae4796d28bb6155b0 /include/sway | |
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 'include/sway')
-rw-r--r-- | include/sway/commands.h | 1 | ||||
-rw-r--r-- | include/sway/config.h | 11 | ||||
-rw-r--r-- | include/sway/tree/view.h | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h index 8e91c158..b0b5ed0f 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h | |||
@@ -117,6 +117,7 @@ sway_cmd cmd_floating_modifier; | |||
117 | sway_cmd cmd_floating_scroll; | 117 | sway_cmd cmd_floating_scroll; |
118 | sway_cmd cmd_focus; | 118 | sway_cmd cmd_focus; |
119 | sway_cmd cmd_focus_follows_mouse; | 119 | sway_cmd cmd_focus_follows_mouse; |
120 | sway_cmd cmd_focus_on_window_activation; | ||
120 | sway_cmd cmd_focus_wrapping; | 121 | sway_cmd cmd_focus_wrapping; |
121 | sway_cmd cmd_font; | 122 | sway_cmd cmd_font; |
122 | sway_cmd cmd_for_window; | 123 | sway_cmd cmd_for_window; |
diff --git a/include/sway/config.h b/include/sway/config.h index 18d10faa..45fa73c4 100644 --- a/include/sway/config.h +++ b/include/sway/config.h | |||
@@ -58,6 +58,16 @@ struct sway_mouse_binding { | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | /** | 60 | /** |
61 | * Focus on window activation. | ||
62 | */ | ||
63 | enum fowa { | ||
64 | FOWA_SMART, | ||
65 | FOWA_URGENT, | ||
66 | FOWA_FOCUS, | ||
67 | FOWA_NONE, | ||
68 | }; | ||
69 | |||
70 | /** | ||
61 | * A "mode" of keybindings created via the `mode` command. | 71 | * A "mode" of keybindings created via the `mode` command. |
62 | */ | 72 | */ |
63 | struct sway_mode { | 73 | struct sway_mode { |
@@ -340,6 +350,7 @@ struct sway_config { | |||
340 | size_t font_height; | 350 | size_t font_height; |
341 | bool pango_markup; | 351 | bool pango_markup; |
342 | size_t urgent_timeout; | 352 | size_t urgent_timeout; |
353 | enum fowa focus_on_window_activation; | ||
343 | 354 | ||
344 | // Flags | 355 | // Flags |
345 | bool focus_follows_mouse; | 356 | bool focus_follows_mouse; |
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index f73ce571..382ab6b9 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -167,6 +167,7 @@ struct sway_xwayland_view { | |||
167 | struct wl_listener request_maximize; | 167 | struct wl_listener request_maximize; |
168 | struct wl_listener request_configure; | 168 | struct wl_listener request_configure; |
169 | struct wl_listener request_fullscreen; | 169 | struct wl_listener request_fullscreen; |
170 | struct wl_listener request_activate; | ||
170 | struct wl_listener set_title; | 171 | struct wl_listener set_title; |
171 | struct wl_listener set_class; | 172 | struct wl_listener set_class; |
172 | struct wl_listener set_window_type; | 173 | struct wl_listener set_window_type; |
@@ -259,6 +260,11 @@ void view_autoconfigure(struct sway_view *view); | |||
259 | 260 | ||
260 | void view_set_activated(struct sway_view *view, bool activated); | 261 | void view_set_activated(struct sway_view *view, bool activated); |
261 | 262 | ||
263 | /** | ||
264 | * Called when the view requests to be focused. | ||
265 | */ | ||
266 | void view_request_activate(struct sway_view *view); | ||
267 | |||
262 | void view_set_tiled(struct sway_view *view, bool tiled); | 268 | void view_set_tiled(struct sway_view *view, bool tiled); |
263 | 269 | ||
264 | void view_close(struct sway_view *view); | 270 | void view_close(struct sway_view *view); |