diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 08e20af09d..83cf454179 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -902,10 +902,6 @@ gdk_wayland_window_create_surface (GdkWindow *window) wl_surface_set_user_data (impl->surface, window); wl_surface_add_listener (impl->surface, &surface_listener, window); - - if (display_wayland->gtk_shell) - impl->gtk_surface = gtk_shell_get_gtk_surface (display_wayland->gtk_shell, - impl->surface); } static void @@ -1054,6 +1050,7 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window, static void gdk_wayland_window_map (GdkWindow *window) { + GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)); GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); GdkWindowImplWayland *parent; GdkWindow *transient_for; @@ -1116,6 +1113,10 @@ gdk_wayland_window_map (GdkWindow *window) mapped: impl->mapped = TRUE; + + if (display_wayland->gtk_shell) + impl->gtk_surface = gtk_shell_get_gtk_surface (display_wayland->gtk_shell, + impl->surface); } } @@ -2300,9 +2301,6 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window, impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - if (!impl->surface) - gdk_wayland_window_create_surface (window); - if (impl->gtk_surface == NULL) return; diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c index caee9b1c6e..ce51233b9c 100644 --- a/gtk/gtkapplicationwindow.c +++ b/gtk/gtkapplicationwindow.c @@ -750,6 +750,8 @@ gtk_application_window_real_map (GtkWidget *widget) if (window->priv->menubar) gtk_widget_map (window->priv->menubar); + GTK_WIDGET_CLASS (gtk_application_window_parent_class)->map (widget); + #ifdef GDK_WINDOWING_WAYLAND { GdkWindow *gdkwindow; @@ -770,8 +772,6 @@ gtk_application_window_real_map (GtkWidget *widget) } } #endif - - GTK_WIDGET_CLASS (gtk_application_window_parent_class)->map (widget); } static void