]> git.mdlowis.com Git - proto/labwc.git/commit
view: Move xdg_surface + xwayland_surface to derived structs
authorJohn Lindgren <john@jlindgren.net>
Fri, 25 Nov 2022 18:41:12 +0000 (13:41 -0500)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 25 Nov 2022 22:21:17 +0000 (22:21 +0000)
commit4da37c65326db1017b3fad6aebb3f468202e1610
treeb11411e3b06b0b7ee4a94d841501872fb657b684
parentdf7276345feb6faad4f0e6751057699c16bc56b4
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.
include/view.h
src/cursor.c
src/desktop.c
src/osd.c
src/view.c
src/xdg.c
src/xwayland.c