diff options
author | Tony Crisci <tony@dubstepdish.com> | 2018-03-25 11:04:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-25 11:04:37 -0400 |
commit | 5617a595981a10ec2e7d5d4808b3201bcf35f44e (patch) | |
tree | a6bd2d6479b593e10ded21caf942f373d478a3fa | |
parent | 80d3561d325335e92b196f7cb5797eea9d71d17d (diff) | |
parent | 731ee240899da70313412d7792946418ee663f15 (diff) |
Merge pull request #741 from emersion/unmapped-surface-destroy
xdg-shell, xdg-shell-v6: don't emit unmap if surface is unmapped
-rw-r--r-- | types/wlr_xdg_shell.c | 4 | ||||
-rw-r--r-- | types/wlr_xdg_shell_v6.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/types/wlr_xdg_shell.c b/types/wlr_xdg_shell.c index f08f9c77..cf713eb9 100644 --- a/types/wlr_xdg_shell.c +++ b/types/wlr_xdg_shell.c @@ -194,7 +194,9 @@ static void xdg_surface_unmap(struct wlr_xdg_surface *surface) { assert(surface->role != WLR_XDG_SURFACE_ROLE_NONE); // TODO: probably need to ungrab before this event - wlr_signal_emit_safe(&surface->events.unmap, surface); + if (surface->mapped) { + wlr_signal_emit_safe(&surface->events.unmap, surface); + } if (surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) { wl_resource_set_user_data(surface->toplevel->resource, NULL); diff --git a/types/wlr_xdg_shell_v6.c b/types/wlr_xdg_shell_v6.c index 0043330c..464e0157 100644 --- a/types/wlr_xdg_shell_v6.c +++ b/types/wlr_xdg_shell_v6.c @@ -194,7 +194,9 @@ static void xdg_surface_unmap(struct wlr_xdg_surface_v6 *surface) { assert(surface->role != WLR_XDG_SURFACE_V6_ROLE_NONE); // TODO: probably need to ungrab before this event - wlr_signal_emit_safe(&surface->events.unmap, surface); + if (surface->mapped) { + wlr_signal_emit_safe(&surface->events.unmap, surface); + } if (surface->role == WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL) { wl_resource_set_user_data(surface->toplevel->resource, NULL); |