compositor: drop role object NULL checks in handlers

Instead, move the check to the caller.
This commit is contained in:
Kirill Primak 2022-11-06 13:54:24 +03:00
parent 32daa43a45
commit 099b9de752
8 changed files with 6 additions and 62 deletions

View file

@ -824,9 +824,6 @@ static void read_surface_property(struct wlr_xwm *xwm,
static void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) {
assert(wlr_surface->role == &xwayland_surface_role);
struct wlr_xwayland_surface *surface = wlr_surface->role_data;
if (surface == NULL) {
return;
}
if (!surface->mapped && wlr_surface_has_buffer(surface->surface)) {
surface->mapped = true;
@ -839,9 +836,6 @@ static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface,
const struct wlr_surface_state *state) {
assert(wlr_surface->role == &xwayland_surface_role);
struct wlr_xwayland_surface *surface = wlr_surface->role_data;
if (surface == NULL) {
return;
}
if (state->committed & WLR_SURFACE_STATE_BUFFER && state->buffer == NULL) {
// This is a NULL commit
@ -856,9 +850,6 @@ static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface,
static void xwayland_surface_role_destroy(struct wlr_surface *wlr_surface) {
assert(wlr_surface->role == &xwayland_surface_role);
struct wlr_xwayland_surface *surface = wlr_surface->role_data;
if (surface == NULL) {
return;
}
if (surface->mapped) {
wl_signal_emit_mutable(&surface->events.unmap, surface);