summaryrefslogtreecommitdiff
path: root/mate-panel/libmate-panel-applet-private/panel-applet-frame-dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'mate-panel/libmate-panel-applet-private/panel-applet-frame-dbus.c')
-rw-r--r--mate-panel/libmate-panel-applet-private/panel-applet-frame-dbus.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/mate-panel/libmate-panel-applet-private/panel-applet-frame-dbus.c b/mate-panel/libmate-panel-applet-private/panel-applet-frame-dbus.c
index 920519f9..449f4db3 100644
--- a/mate-panel/libmate-panel-applet-private/panel-applet-frame-dbus.c
+++ b/mate-panel/libmate-panel-applet-private/panel-applet-frame-dbus.c
@@ -42,7 +42,7 @@ G_DEFINE_TYPE (MatePanelAppletFrameDBus,
struct _MatePanelAppletFrameDBusPrivate
{
MatePanelAppletContainer *container;
- GCancellable *bg_cancellable;
+ gconstpointer bg_operation;
};
/* Keep in sync with mate-panel-applet.h. Uggh. */
@@ -235,10 +235,8 @@ container_child_background_set (GObject *source_object,
mate_panel_applet_container_child_set_finish (container, res, NULL);
- if (frame->priv->bg_cancellable)
- g_object_unref (frame->priv->bg_cancellable);
-
- frame->priv->bg_cancellable = NULL;
+ if (frame->priv->bg_operation)
+ frame->priv->bg_operation = NULL;
}
static void
@@ -246,22 +244,23 @@ mate_panel_applet_frame_dbus_change_background (MatePanelAppletFrame *frame,
PanelBackgroundType type)
{
MatePanelAppletFrameDBus *dbus_frame = MATE_PANEL_APPLET_FRAME_DBUS (frame);
+ MatePanelAppletFrameDBusPrivate *priv = dbus_frame->priv;
char *bg_str;
bg_str = _mate_panel_applet_frame_get_background_string (
frame, PANEL_WIDGET (gtk_widget_get_parent (GTK_WIDGET (frame))), type);
if (bg_str != NULL) {
- if (dbus_frame->priv->bg_cancellable)
- g_cancellable_cancel (dbus_frame->priv->bg_cancellable);
- dbus_frame->priv->bg_cancellable = g_cancellable_new ();
+ if (priv->bg_operation)
+ mate_panel_applet_container_cancel_operation (priv->container, priv->bg_operation);
- mate_panel_applet_container_child_set (dbus_frame->priv->container,
+ priv->bg_operation = mate_panel_applet_container_child_set (priv->container,
"background",
g_variant_new_string (bg_str),
- dbus_frame->priv->bg_cancellable,
+ NULL,
container_child_background_set,
dbus_frame);
+
g_free (bg_str);
}
}
@@ -328,9 +327,8 @@ mate_panel_applet_frame_dbus_finalize (GObject *object)
{
MatePanelAppletFrameDBus *frame = MATE_PANEL_APPLET_FRAME_DBUS (object);
- if (frame->priv->bg_cancellable)
- g_object_unref (frame->priv->bg_cancellable);
- frame->priv->bg_cancellable = NULL;
+ if (frame->priv->bg_operation)
+ frame->priv->bg_operation = NULL;
G_OBJECT_CLASS (mate_panel_applet_frame_dbus_parent_class)->finalize (object);
}
@@ -348,7 +346,7 @@ mate_panel_applet_frame_dbus_init (MatePanelAppletFrameDBus *frame)
gtk_widget_show (container);
gtk_container_add (GTK_CONTAINER (frame), container);
frame->priv->container = MATE_PANEL_APPLET_CONTAINER (container);
- frame->priv->bg_cancellable = NULL;
+ frame->priv->bg_operation = NULL;
g_signal_connect (container, "child-property-changed::flags",
G_CALLBACK (mate_panel_applet_frame_dbus_flags_changed),