view: minimize parents/children together

Minimize the whole view-hierarchy from top to bottom regardless of which
one in the hierarchy requested the minimize. For example, if an 'About' or
'Open File' dialog is minimized, its toplevel is minimized also, and vice
versa.

For reference:
- This is consistent with in openbox, where child views (dialogs) can be
  minimized, but when doing so the parent is also minimized.
- In mutter these types of dialogs cannot be minimized (via client-menu or
  otherwise).
- In both openbox and mutter, when a toplevel window is minimized any open
  children are also minimized.
This commit is contained in:
Johan Malm 2023-08-02 20:57:39 +01:00 committed by Johan Malm
parent d961dbf9b0
commit e991eae103
4 changed files with 134 additions and 8 deletions

View file

@ -55,6 +55,8 @@ struct view_impl {
void (*minimize)(struct view *view, bool minimize);
void (*move_to_front)(struct view *view);
void (*move_to_back)(struct view *view);
struct view *(*get_root)(struct view *self);
void (*append_children)(struct view *self, struct wl_array *children);
};
struct view {
@ -212,6 +214,8 @@ void view_snap_to_region(struct view *view, struct region *region, bool store_na
void view_move_to_front(struct view *view);
void view_move_to_back(struct view *view);
struct view *view_get_root(struct view *view);
void view_append_children(struct view *view, struct wl_array *children);
const char *view_get_string_prop(struct view *view, const char *prop);
void view_update_title(struct view *view);