mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
view: Move xdg_surface + xwayland_surface to derived structs
Add xdg_surface_from_view() + xwayland_surface_from_view() accessors that assert() the view is of the expected type before returning. Fix a real bug in xdg.c parent_of() that dereferenced `view->xdg_surface->toplevel` without first checking `view->type`. The goal of the new accessors is to catch similar bugs in future.
This commit is contained in:
parent
df7276345f
commit
4da37c6532
7 changed files with 147 additions and 106 deletions
|
|
@ -186,7 +186,8 @@ view_adjust_size(struct view *view, int *w, int *h)
|
|||
int min_height = MIN_VIEW_HEIGHT;
|
||||
#if HAVE_XWAYLAND
|
||||
if (view->type == LAB_XWAYLAND_VIEW) {
|
||||
xcb_size_hints_t *hints = view->xwayland_surface->size_hints;
|
||||
xcb_size_hints_t *hints =
|
||||
xwayland_surface_from_view(view)->size_hints;
|
||||
|
||||
/*
|
||||
* Honor size increments from WM_SIZE_HINTS. Typically, X11
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue