Bug 1940497 [Wayland] Don't run unmap callback for hidden WaylandSurface r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D233621
This commit is contained in:
stransky
2025-01-09 09:04:56 +00:00
parent 439fac9e92
commit af6dc8b373

View File

@@ -124,7 +124,11 @@ void moz_container_wayland_unmap(GtkWidget* widget) {
(void*)moz_container_get_nsWindow(MOZ_CONTAINER(widget)));
WaylandSurface* surface = MOZ_WL_SURFACE(MOZ_CONTAINER(widget));
surface->RunUnmapCallback();
// MozContainer map/unmap is processed on main thread only
// so we don't need to lock WaylandSurface here.
if (surface->IsMapped()) {
surface->RunUnmapCallback();
}
WaylandSurfaceLock lock(surface);
if (surface->IsPendingGdkCleanup()) {