diff --git a/src/core/window.c b/src/core/window.c index 7faa3e95c..12121b455 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -158,12 +158,17 @@ static MetaWindow * meta_window_find_tile_match (MetaWindow *window, MetaTileMode mode); static void update_edge_constraints (MetaWindow *window); +static void initable_iface_init (GInitableIface *initable_iface); + typedef struct _MetaWindowPrivate { MetaQueueType queued_types; } MetaWindowPrivate; -G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaWindow, meta_window, G_TYPE_OBJECT) +G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaWindow, meta_window, G_TYPE_OBJECT, + G_ADD_PRIVATE (MetaWindow) + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, + initable_iface_init)) enum { @@ -1366,11 +1371,28 @@ meta_window_constructed (GObject *object) unminimize_window_and_all_transient_parents (window); window->constructing = FALSE; +} + +static gboolean +meta_window_initable_init (GInitable *initable, + GCancellable *cancellable, + GError **error) +{ + MetaWindow *window = META_WINDOW (initable); + MetaDisplay *display = window->display; meta_display_notify_window_created (display, window); if (window->wm_state_demands_attention) g_signal_emit_by_name (display, "window-demands-attention", window); + + return TRUE; +} + +static void +initable_iface_init (GInitableIface *initable_iface) +{ + initable_iface->init = meta_window_initable_init; } static gboolean diff --git a/src/wayland/meta-window-wayland.c b/src/wayland/meta-window-wayland.c index 3be11de40..b31d11d46 100644 --- a/src/wayland/meta-window-wayland.c +++ b/src/wayland/meta-window-wayland.c @@ -908,11 +908,12 @@ meta_window_wayland_new (MetaDisplay *display, MetaWindowWayland *wl_window; MetaWindow *window; - window = g_object_new (META_TYPE_WINDOW_WAYLAND, - "display", display, - "effect", META_COMP_EFFECT_CREATE, - "surface", surface, - NULL); + window = g_initable_new (META_TYPE_WINDOW_WAYLAND, + NULL, NULL, + "display", display, + "effect", META_COMP_EFFECT_CREATE, + "surface", surface, + NULL); wl_window = META_WINDOW_WAYLAND (window); set_geometry_scale_for_window (wl_window, wl_window->geometry_scale); diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index d69e2310b..1566e1e4a 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -3890,22 +3890,24 @@ meta_window_x11_new (MetaDisplay *display, #ifdef HAVE_XWAYLAND if (meta_is_wayland_compositor ()) { - window = g_object_new (META_TYPE_WINDOW_XWAYLAND, - "display", display, - "effect", effect, - "attributes", &attrs, - "xwindow", xwindow, - NULL); + window = g_initable_new (META_TYPE_WINDOW_XWAYLAND, + NULL, NULL, + "display", display, + "effect", effect, + "attributes", &attrs, + "xwindow", xwindow, + NULL); } else #endif { - window = g_object_new (META_TYPE_WINDOW_X11, - "display", display, - "effect", effect, - "attributes", &attrs, - "xwindow", xwindow, - NULL); + window = g_initable_new (META_TYPE_WINDOW_X11, + NULL, NULL, + "display", display, + "effect", effect, + "attributes", &attrs, + "xwindow", xwindow, + NULL); } if (existing_wm_state == IconicState) {