From def92d1b8e9d373e2f6f27c366d578d97d8960c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:50 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- widget/gtk/MozContainer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'widget/gtk/MozContainer.cpp') diff --git a/widget/gtk/MozContainer.cpp b/widget/gtk/MozContainer.cpp index 775ae0488f..446dc97a66 100644 --- a/widget/gtk/MozContainer.cpp +++ b/widget/gtk/MozContainer.cpp @@ -87,19 +87,18 @@ void moz_container_class_init(MozContainerClass* klass) { GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); */ GtkWidgetClass* widget_class = GTK_WIDGET_CLASS(klass); + widget_class->map = moz_container_map; widget_class->realize = moz_container_realize; widget_class->unrealize = moz_container_unrealize; widget_class->destroy = moz_container_destroy; #ifdef MOZ_WAYLAND if (mozilla::widget::GdkIsWaylandDisplay()) { - widget_class->map = moz_container_wayland_map; widget_class->size_allocate = moz_container_wayland_size_allocate; widget_class->map_event = moz_container_wayland_map_event; widget_class->unmap = moz_container_wayland_unmap; } else { #endif - widget_class->map = moz_container_map; widget_class->size_allocate = moz_container_size_allocate; widget_class->unmap = moz_container_unmap; #ifdef MOZ_WAYLAND @@ -130,6 +129,10 @@ void moz_container_map(GtkWidget* widget) { if (gtk_widget_get_has_window(widget)) { gdk_window_show(gtk_widget_get_window(widget)); } + + // Enable rendering to nsWindow/MozContainer + nsWindow* window = moz_container_get_nsWindow(MOZ_CONTAINER(widget)); + window->OnMap(); } void moz_container_unmap(GtkWidget* widget) { @@ -138,9 +141,9 @@ void moz_container_unmap(GtkWidget* widget) { LOGCONTAINER(("moz_container_unmap() [%p]", (void*)moz_container_get_nsWindow(MOZ_CONTAINER(widget)))); - // Disable rendering to MozContainer before we unmap it. + // Disable rendering to nsWindow/MozContainer before we really unmap it. nsWindow* window = moz_container_get_nsWindow(MOZ_CONTAINER(widget)); - window->DisableRendering(); + window->OnUnmap(); gtk_widget_set_mapped(widget, FALSE); -- cgit v1.2.3