Implement focus_on_window_activation

Depends on https://github.com/swaywm/wlroots/pull/1223
This commit is contained in:
Ryan Dwyer 2018-09-02 15:03:58 +10:00
parent 159edc6d13
commit f057a0195e
8 changed files with 86 additions and 0 deletions

View file

@ -117,6 +117,7 @@ sway_cmd cmd_floating_modifier;
sway_cmd cmd_floating_scroll;
sway_cmd cmd_focus;
sway_cmd cmd_focus_follows_mouse;
sway_cmd cmd_focus_on_window_activation;
sway_cmd cmd_focus_wrapping;
sway_cmd cmd_font;
sway_cmd cmd_for_window;

View file

@ -57,6 +57,16 @@ struct sway_mouse_binding {
char *command;
};
/**
* Focus on window activation.
*/
enum fowa {
FOWA_SMART,
FOWA_URGENT,
FOWA_FOCUS,
FOWA_NONE,
};
/**
* A "mode" of keybindings created via the `mode` command.
*/
@ -340,6 +350,7 @@ struct sway_config {
size_t font_height;
bool pango_markup;
size_t urgent_timeout;
enum fowa focus_on_window_activation;
// Flags
bool focus_follows_mouse;

View file

@ -167,6 +167,7 @@ struct sway_xwayland_view {
struct wl_listener request_maximize;
struct wl_listener request_configure;
struct wl_listener request_fullscreen;
struct wl_listener request_activate;
struct wl_listener set_title;
struct wl_listener set_class;
struct wl_listener set_window_type;
@ -259,6 +260,11 @@ void view_autoconfigure(struct sway_view *view);
void view_set_activated(struct sway_view *view, bool activated);
/**
* Called when the view requests to be focused.
*/
void view_request_activate(struct sway_view *view);
void view_set_tiled(struct sway_view *view, bool tiled);
void view_close(struct sway_view *view);