mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
xdg: take into account minimum window size for resizing (#2221)
This is especially relavant for <resize drawContents="no">.
This commit is contained in:
parent
d2b161bdf8
commit
a5d89a2e4c
1 changed files with 15 additions and 0 deletions
15
src/xdg.c
15
src/xdg.c
|
|
@ -44,6 +44,20 @@ xdg_toplevel_from_view(struct view *view)
|
|||
return xdg_surface->toplevel;
|
||||
}
|
||||
|
||||
static struct view_size_hints
|
||||
xdg_toplevel_view_get_size_hints(struct view *view)
|
||||
{
|
||||
assert(view);
|
||||
|
||||
struct wlr_xdg_toplevel *toplevel = xdg_toplevel_from_view(view);
|
||||
struct wlr_xdg_toplevel_state *state = &toplevel->current;
|
||||
|
||||
return (struct view_size_hints){
|
||||
.min_width = state->min_width,
|
||||
.min_height = state->min_height,
|
||||
};
|
||||
}
|
||||
|
||||
static bool
|
||||
xdg_toplevel_view_contains_window_type(struct view *view, int32_t window_type)
|
||||
{
|
||||
|
|
@ -779,6 +793,7 @@ static const struct view_impl xdg_toplevel_view_impl = {
|
|||
.move_to_back = view_impl_move_to_back,
|
||||
.get_root = xdg_toplevel_view_get_root,
|
||||
.append_children = xdg_toplevel_view_append_children,
|
||||
.get_size_hints = xdg_toplevel_view_get_size_hints,
|
||||
.contains_window_type = xdg_toplevel_view_contains_window_type,
|
||||
.get_pid = xdg_view_get_pid,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue