mirror of
https://github.com/labwc/labwc.git
synced 2026-04-02 07:15:43 -04:00
src/xwayland.c: make size_hints globally accessible
This commit is contained in:
parent
a89bcc3c60
commit
c8321e3264
2 changed files with 17 additions and 0 deletions
|
|
@ -57,6 +57,7 @@ struct view_impl {
|
||||||
void (*move_to_back)(struct view *view);
|
void (*move_to_back)(struct view *view);
|
||||||
struct view *(*get_root)(struct view *self);
|
struct view *(*get_root)(struct view *self);
|
||||||
void (*append_children)(struct view *self, struct wl_array *children);
|
void (*append_children)(struct view *self, struct wl_array *children);
|
||||||
|
void (*fill_size_hints)(struct view *self, struct wlr_box *box);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct view {
|
struct view {
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,21 @@ xwayland_apply_size_hints(struct view *view, int *w, int *h)
|
||||||
return false;
|
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 *
|
static struct wlr_xwayland_surface *
|
||||||
top_parent_of(struct view *view)
|
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,
|
.move_to_back = xwayland_view_move_to_back,
|
||||||
.get_root = xwayland_view_get_root,
|
.get_root = xwayland_view_get_root,
|
||||||
.append_children = xwayland_view_append_children,
|
.append_children = xwayland_view_append_children,
|
||||||
|
.fill_size_hints = xwayland_view_fill_size_hints,
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue