diff options
Diffstat (limited to 'src/platform/wayland/popup.c')
| -rw-r--r-- | src/platform/wayland/popup.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/platform/wayland/popup.c b/src/platform/wayland/popup.c index 1ae4805..f66e155 100644 --- a/src/platform/wayland/popup.c +++ b/src/platform/wayland/popup.c @@ -136,9 +136,18 @@ struct wayland_surface *wayland_surface_create_popup(struct wayland_surface *par { struct wayland_display *c = parent ? parent->conn : NULL; struct seat *seat = c ? (c->active_seat ? c->active_seat : c->seats) : NULL; - if (!c || c->lost || parent->closed || !parent->xdg_surface || !seat || - !seat->input_serial || !popup_spec_valid(parent, spec)) + if (!c || !parent->xdg_surface || parent->closed || !popup_spec_valid(parent, spec)) { + errno = EINVAL; return NULL; + } + if (c->lost) { + errno = ENOTCONN; + return NULL; + } + if (!seat || !seat->input_serial) { + errno = ESTALE; + return NULL; + } struct wayland_surface *w = calloc(1, sizeof(*w)); if (!w) |
