aboutsummaryrefslogtreecommitdiff
path: root/xwayland/xwm.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-07-27 13:21:03 -0400
committerGitHub <noreply@github.com>2018-07-27 13:21:03 -0400
commitf1b65b34a6caff8db7c729b6362ec57f2707aa1a (patch)
tree7c2193e16dc71534b59a06de912310e84ce41575 /xwayland/xwm.c
parentb6ed1f29a4dbba93eb53c32ec5492db8ee1d9343 (diff)
parent16d7e09d996f7fd211e3a6ff8960a15217ca3710 (diff)
Merge pull request #1127 from emersion/surface-precommit
surface: add wlr_surface_role.precommit
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r--xwayland/xwm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 6632b5fc..7999480a 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -654,9 +654,27 @@ static void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) {
}
}
+static void xwayland_surface_role_precommit(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 (wlr_surface->pending.committed & WLR_SURFACE_STATE_BUFFER &&
+ wlr_surface->pending.buffer_resource == NULL) {
+ // This is a NULL commit
+ if (surface->mapped) {
+ wlr_signal_emit_safe(&surface->events.unmap, surface);
+ surface->mapped = false;
+ }
+ }
+}
+
static const struct wlr_surface_role xwayland_surface_role = {
.name = "wlr_xwayland_surface",
.commit = xwayland_surface_role_commit,
+ .precommit = xwayland_surface_role_precommit,
};
static void handle_surface_destroy(struct wl_listener *listener, void *data) {