From 832ebc896655cb5ca7689559d4e42b426d764e71 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Sun, 7 Oct 2018 20:40:05 +1000 Subject: Implement popup_during_fullscreen This introduces a new view_impl function: is_transient_for. Similar to container_has_ancestor but works using the surface parents rather than the tree. This patch modifies view_is_visible, container_at and so on to allow transient views to function normally when they're in front of a fullscreen view. --- include/sway/commands.h | 1 + include/sway/config.h | 7 +++++++ include/sway/tree/view.h | 4 ++++ 3 files changed, 12 insertions(+) (limited to 'include/sway') diff --git a/include/sway/commands.h b/include/sway/commands.h index 21b8b87a..48228a98 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -154,6 +154,7 @@ sway_cmd cmd_new_window; sway_cmd cmd_no_focus; sway_cmd cmd_output; sway_cmd cmd_permit; +sway_cmd cmd_popup_during_fullscreen; sway_cmd cmd_reject; sway_cmd cmd_reload; sway_cmd cmd_rename; diff --git a/include/sway/config.h b/include/sway/config.h index 0e51fbfb..00b5f25b 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -256,6 +256,12 @@ enum edge_border_types { E_SMART_NO_GAPS, /**< hide both if one window and gaps to edge is zero */ }; +enum sway_popup_during_fullscreen { + POPUP_SMART, + POPUP_IGNORE, + POPUP_LEAVE, +}; + enum command_context { CONTEXT_CONFIG = 1, CONTEXT_BINDING = 2, @@ -355,6 +361,7 @@ struct sway_config { bool pango_markup; size_t urgent_timeout; enum sway_fowa focus_on_window_activation; + enum sway_popup_during_fullscreen popup_during_fullscreen; // Flags bool focus_follows_mouse; diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 028be536..eb1e98e1 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -49,6 +49,8 @@ struct sway_view_impl { wlr_surface_iterator_func_t iterator, void *user_data); void (*for_each_popup)(struct sway_view *view, wlr_surface_iterator_func_t iterator, void *user_data); + bool (*is_transient_for)(struct sway_view *child, + struct sway_view *ancestor); void (*close)(struct sway_view *view); void (*close_popups)(struct sway_view *view); void (*destroy)(struct sway_view *view); @@ -396,4 +398,6 @@ void view_remove_saved_buffer(struct sway_view *view); void view_save_buffer(struct sway_view *view); +bool view_is_transient_for(struct sway_view *child, struct sway_view *ancestor); + #endif -- cgit v1.2.3-54-g00ecf