mirror of
https://github.com/labwc/labwc.git
synced 2026-02-05 04:06:33 -05: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;
|
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
|
static bool
|
||||||
xdg_toplevel_view_contains_window_type(struct view *view, int32_t window_type)
|
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,
|
.move_to_back = view_impl_move_to_back,
|
||||||
.get_root = xdg_toplevel_view_get_root,
|
.get_root = xdg_toplevel_view_get_root,
|
||||||
.append_children = xdg_toplevel_view_append_children,
|
.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,
|
.contains_window_type = xdg_toplevel_view_contains_window_type,
|
||||||
.get_pid = xdg_view_get_pid,
|
.get_pid = xdg_view_get_pid,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue