mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
compositor: drop role object NULL checks in handlers
Instead, move the check to the caller.
This commit is contained in:
parent
32daa43a45
commit
099b9de752
8 changed files with 6 additions and 62 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue