{
GdkMacosSurface parent_instance;
GdkPopupLayout *layout;
+ guint attached : 1;
};
struct _GdkMacosPopupSurfaceClass
if (GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self)))
return TRUE;
+ if (!self->attached && GDK_SURFACE (self)->parent != NULL)
+ _gdk_macos_popup_surface_attach_to_parent (self);
+
if (GDK_SURFACE (self)->autohide)
{
GdkDisplay *display = gdk_surface_get_display (GDK_SURFACE (popup));
LAST_PROP,
};
+static void
+_gdk_macos_popup_surface_hide (GdkSurface *surface)
+{
+ GdkMacosPopupSurface *self = (GdkMacosPopupSurface *)surface;
+
+ g_assert (GDK_IS_MACOS_POPUP_SURFACE (self));
+
+ if (self->attached)
+ _gdk_macos_popup_surface_detach_from_parent (self);
+
+ GDK_SURFACE_CLASS (_gdk_macos_popup_surface_parent_class)->hide (surface);
+}
+
static void
_gdk_macos_popup_surface_finalize (GObject *object)
{
_gdk_macos_popup_surface_class_init (GdkMacosPopupSurfaceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GdkSurfaceClass *surface_class = GDK_SURFACE_CLASS (klass);
object_class->finalize = _gdk_macos_popup_surface_finalize;
object_class->get_property = _gdk_macos_popup_surface_get_property;
object_class->set_property = _gdk_macos_popup_surface_set_property;
+ surface_class->hide = _gdk_macos_popup_surface_hide;
+
gdk_popup_install_properties (object_class, LAST_PROP);
}
[parent addChildWindow:window ordered:NSWindowAbove];
+ self->attached = TRUE;
+
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (surface->display));
}
}
[parent removeChildWindow:window];
+ self->attached = FALSE;
+
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (surface->display));
}
}