From c8321e3264f1965f2e029b25e08b85ad15e2088e Mon Sep 17 00:00:00 2001 From: Consolatis <35009135+Consolatis@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:00:56 +0200 Subject: [PATCH] src/xwayland.c: make size_hints globally accessible --- include/view.h | 1 + src/xwayland.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/view.h b/include/view.h index 5ba62a5b..01468745 100644 --- a/include/view.h +++ b/include/view.h @@ -57,6 +57,7 @@ struct view_impl { void (*move_to_back)(struct view *view); struct view *(*get_root)(struct view *self); void (*append_children)(struct view *self, struct wl_array *children); + void (*fill_size_hints)(struct view *self, struct wlr_box *box); }; struct view { diff --git a/src/xwayland.c b/src/xwayland.c index 2a67f0b6..4f9a84bd 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -50,6 +50,21 @@ xwayland_apply_size_hints(struct view *view, int *w, int *h) return false; } +static void +xwayland_view_fill_size_hints(struct view *view, struct wlr_box *box) +{ + if (view->type == LAB_XWAYLAND_VIEW) { + xcb_size_hints_t *hints = xwayland_surface_from_view(view)->size_hints; + if (hints) { + box->width = hints->width_inc; + box->height = hints->height_inc; + return; + } + } + box->width = 0; + box->height = 0; +} + static struct wlr_xwayland_surface * top_parent_of(struct view *view) { @@ -639,6 +654,7 @@ static const struct view_impl xwayland_view_impl = { .move_to_back = xwayland_view_move_to_back, .get_root = xwayland_view_get_root, .append_children = xwayland_view_append_children, + .fill_size_hints = xwayland_view_fill_size_hints, }; void -- 2.52.0