diff --git a/src/compositor/mutter/compositor-mutter.c b/src/compositor/mutter/compositor-mutter.c index 65c1cd357..8efc7af6b 100644 --- a/src/compositor/mutter/compositor-mutter.c +++ b/src/compositor/mutter/compositor-mutter.c @@ -1221,7 +1221,7 @@ add_win (MetaWindow *window) meta_verbose ("added 0x%x (%p) type:", (guint)top_window, cw); /* Hang our compositor window state off the MetaWindow for fast retrieval */ - meta_window_set_compositor_private (window, cw); + meta_window_set_compositor_private (window, G_OBJECT (cw)); /* * Add this to the list at the top of the stack before it is mapped so that @@ -1745,7 +1745,7 @@ clutter_cmp_remove_window (MetaCompositor *compositor, MutterWindow *cw = NULL; DEBUG_TRACE ("clutter_cmp_remove_window\n"); - cw = meta_window_get_compositor_private (window); + cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); if (!cw) return; @@ -1874,7 +1874,7 @@ static void clutter_cmp_map_window (MetaCompositor *compositor, MetaWindow *window) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); DEBUG_TRACE ("clutter_cmp_map_window\n"); if (!cw) return; @@ -1887,7 +1887,7 @@ static void clutter_cmp_unmap_window (MetaCompositor *compositor, MetaWindow *window) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); DEBUG_TRACE ("clutter_cmp_unmap_window\n"); if (!cw) return; @@ -1903,7 +1903,7 @@ clutter_cmp_minimize_window (MetaCompositor *compositor, MetaRectangle *icon_rect) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -1939,7 +1939,7 @@ clutter_cmp_unminimize_window (MetaCompositor *compositor, { #ifdef HAVE_COMPOSITE_EXTENSIONS #if 0 - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -1963,7 +1963,7 @@ clutter_cmp_unminimize_window (MetaCompositor *compositor, cw->priv->minimize_in_progress--; } #else - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); DEBUG_TRACE ("clutter_cmp_unminimize_window\n"); if (!cw) return; @@ -1980,7 +1980,7 @@ clutter_cmp_maximize_window (MetaCompositor *compositor, MetaRectangle *rect) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -2010,7 +2010,7 @@ clutter_cmp_unmaximize_window (MetaCompositor *compositor, MetaRectangle *rect) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); MetaCompScreen *info = meta_screen_get_compositor_data (screen); @@ -2169,7 +2169,7 @@ clutter_cmp_sync_stack (MetaCompositor *compositor, for (tmp = stack; tmp != NULL; tmp = tmp->next) { MetaWindow *window = tmp->data; - MutterWindow *cw = window->compositor_private; + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); if (!cw) { @@ -2191,7 +2191,7 @@ clutter_cmp_set_window_hidden (MetaCompositor *compositor, MetaWindow *window, gboolean hidden) { - MutterWindow *cw = window->compositor_private; + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaCompScreen *info = meta_screen_get_compositor_data (screen); DEBUG_TRACE ("clutter_cmp_set_window_hidden\n"); @@ -2219,7 +2219,7 @@ clutter_cmp_sync_window_geometry (MetaCompositor *compositor, MetaWindow *window) { #ifdef HAVE_COMPOSITE_EXTENSIONS - MutterWindow *cw = meta_window_get_compositor_private (window); + MutterWindow *cw = MUTTER_WINDOW (meta_window_get_compositor_private (window)); MetaScreen *screen = meta_window_get_screen (window); MetaCompScreen *info = meta_screen_get_compositor_data (screen); diff --git a/src/core/window-private.h b/src/core/window-private.h index efdb3476e..5255b774b 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -360,7 +360,7 @@ struct _MetaWindow MetaGroup *group; #ifdef HAVE_COMPOSITE_EXTENSIONS - void *compositor_private; + GObject *compositor_private; #endif }; diff --git a/src/core/window.c b/src/core/window.c index e4d51cc62..a9a0d9099 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -8707,7 +8707,15 @@ meta_window_get_description (MetaWindow *window) return window->desc; } -void * +/** + * meta_window_get_compositor_private: + * @window: a #MetaWindow + * + * Gets the compositor's wrapper object for @window. + * + * Return value: (transfer none): the wrapper object. + **/ +GObject * meta_window_get_compositor_private (MetaWindow *window) { if (!window) @@ -8716,7 +8724,7 @@ meta_window_get_compositor_private (MetaWindow *window) } void -meta_window_set_compositor_private (MetaWindow *window, void *priv) +meta_window_set_compositor_private (MetaWindow *window, GObject *priv) { if (!window) return; diff --git a/src/include/window.h b/src/include/window.h index b99816dca..1ee2af647 100644 --- a/src/include/window.h +++ b/src/include/window.h @@ -92,8 +92,8 @@ void meta_window_change_workspace_by_index (MetaWindow *window, gint space_index, gboolean append, guint32 timestamp); -void *meta_window_get_compositor_private (MetaWindow *window); -void meta_window_set_compositor_private (MetaWindow *window, void *priv); +GObject *meta_window_get_compositor_private (MetaWindow *window); +void meta_window_set_compositor_private (MetaWindow *window, GObject *priv); void meta_window_configure_notify (MetaWindow *window, XConfigureEvent *event); const char *meta_window_get_role (MetaWindow *window);