"frame-clock", frame_clock,
"title", get_default_title (),
NULL);
- display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, surface);
break;
case GDK_SURFACE_POPUP:
g_warn_if_fail (parent != NULL);
gdk_wayland_surface_destroy (GdkSurface *surface,
gboolean foreign_destroy)
{
- GdkWaylandDisplay *display;
GdkFrameClock *frame_clock;
- g_return_if_fail (GDK_IS_SURFACE (surface));
-
/* Wayland surfaces can't be externally destroyed; we may possibly
* eventually want to use this path at display close-down
*/
frame_clock = gdk_surface_get_frame_clock (surface);
g_signal_handlers_disconnect_by_func (frame_clock, on_frame_clock_before_paint, surface);
g_signal_handlers_disconnect_by_func (frame_clock, on_frame_clock_after_paint, surface);
-
- display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
- display->toplevels = g_list_remove (display->toplevels, surface);
}
static void
static void
gdk_wayland_toplevel_finalize (GObject *object)
{
- GdkWaylandToplevel *wayland_toplevel;
-
- g_return_if_fail (GDK_IS_WAYLAND_TOPLEVEL (object));
+ GdkWaylandToplevel *self = GDK_WAYLAND_TOPLEVEL (object);
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SURFACE (object)));
- wayland_toplevel = GDK_WAYLAND_TOPLEVEL (object);
+ display_wayland->toplevels = g_list_remove (display_wayland->toplevels, self);
- if (gdk_wayland_toplevel_is_exported (wayland_toplevel))
- gdk_wayland_toplevel_unexport_handle (GDK_TOPLEVEL (wayland_toplevel));
+ if (gdk_wayland_toplevel_is_exported (self))
+ gdk_wayland_toplevel_unexport_handle (GDK_TOPLEVEL (self));
- g_free (wayland_toplevel->application.application_id);
- g_free (wayland_toplevel->application.app_menu_path);
- g_free (wayland_toplevel->application.menubar_path);
- g_free (wayland_toplevel->application.window_object_path);
- g_free (wayland_toplevel->application.application_object_path);
- g_free (wayland_toplevel->application.unique_bus_name);
+ g_free (self->application.application_id);
+ g_free (self->application.app_menu_path);
+ g_free (self->application.menubar_path);
+ g_free (self->application.window_object_path);
+ g_free (self->application.application_object_path);
+ g_free (self->application.unique_bus_name);
- g_free (wayland_toplevel->title);
- g_clear_pointer (&wayland_toplevel->shortcuts_inhibitors, g_hash_table_unref);
+ g_free (self->title);
+ g_clear_pointer (&self->shortcuts_inhibitors, g_hash_table_unref);
G_OBJECT_CLASS (gdk_wayland_toplevel_parent_class)->finalize (object);
}
+static void
+gdk_wayland_toplevel_constructed (GObject *object)
+{
+ GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SURFACE (object)));
+
+ display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, object);
+
+ G_OBJECT_CLASS (gdk_wayland_toplevel_parent_class)->constructed (object);
+}
+
static void
gdk_wayland_toplevel_class_init (GdkWaylandToplevelClass *class)
{
object_class->get_property = gdk_wayland_toplevel_get_property;
object_class->set_property = gdk_wayland_toplevel_set_property;
object_class->finalize = gdk_wayland_toplevel_finalize;
+ object_class->constructed = gdk_wayland_toplevel_constructed;
surface_class->compute_size = gdk_wayland_toplevel_compute_size;