aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-08-26 13:09:56 +0300
committerSimon Zeni <simon@bl4ckb0ne.ca>2023-10-02 18:37:09 +0000
commit016494af1b62ed60e33d98835add6b11da86217e (patch)
tree974bf2f8e0279376f0eff597bd8e9cb6fce02f8c
parent5ef42e8e8adece098848fac53c721b6eb3818fc2 (diff)
xdg-surface: assert that xdg_surface isn't inert
-rw-r--r--types/xdg_shell/wlr_xdg_surface.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/types/xdg_shell/wlr_xdg_surface.c b/types/xdg_shell/wlr_xdg_surface.c
index da3afa57..80373fbf 100644
--- a/types/xdg_shell/wlr_xdg_surface.c
+++ b/types/xdg_shell/wlr_xdg_surface.c
@@ -183,13 +183,11 @@ static void xdg_surface_handle_get_popup(struct wl_client *client,
struct wl_resource *positioner_resource) {
struct wlr_xdg_surface *xdg_surface =
wlr_xdg_surface_from_resource(resource);
+ assert(xdg_surface != NULL);
struct wlr_xdg_surface *parent = NULL;
if (parent_resource != NULL) {
parent = wlr_xdg_surface_from_resource(parent_resource);
}
- if (xdg_surface == NULL) {
- return; // TODO: create an inert xdg_popup
- }
struct wlr_xdg_positioner *positioner =
wlr_xdg_positioner_from_resource(positioner_resource);
create_xdg_popup(xdg_surface, parent, positioner, id);
@@ -199,9 +197,7 @@ static void xdg_surface_handle_get_toplevel(struct wl_client *client,
struct wl_resource *resource, uint32_t id) {
struct wlr_xdg_surface *xdg_surface =
wlr_xdg_surface_from_resource(resource);
- if (xdg_surface == NULL) {
- return; // TODO: create an inert xdg_toplevel
- }
+ assert(xdg_surface != NULL);
create_xdg_toplevel(xdg_surface, id);
}
@@ -209,9 +205,7 @@ static void xdg_surface_handle_set_window_geometry(struct wl_client *client,
struct wl_resource *resource, int32_t x, int32_t y, int32_t width,
int32_t height) {
struct wlr_xdg_surface *surface = wlr_xdg_surface_from_resource(resource);
- if (surface == NULL) {
- return;
- }
+ assert(surface != NULL);
if (surface->role == WLR_XDG_SURFACE_ROLE_NONE) {
wl_resource_post_error(surface->resource,