diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-03-31 12:35:33 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-03-31 12:35:33 +0000 |
commit | 20ec5e6e12cca17e3fa8c82f3afc51187f241922 (patch) | |
tree | 05b2bf6432c8349da3734978969b7029e1bd9bbf /monitor | |
parent | 1e7fdb8553f4f4132237ce7c277ce9a2233c6303 (diff) | |
download | gvfs-20ec5e6e12cca17e3fa8c82f3afc51187f241922.tar.gz |
Bug 567635 – flickering context menu item
2009-03-31 Alexander Larsson <alexl@redhat.com>
Bug 567635 – flickering context menu item
* monitor/proxy/gproxyshadowmount.c:
Make sure we return the shadow object as the source_object
when wrapping the shadowed mounts operations.
svn path=/trunk/; revision=2354
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/proxy/gproxyshadowmount.c | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/monitor/proxy/gproxyshadowmount.c b/monitor/proxy/gproxyshadowmount.c index 916cadb5..ae5bcc71 100644 --- a/monitor/proxy/gproxyshadowmount.c +++ b/monitor/proxy/gproxyshadowmount.c @@ -300,19 +300,34 @@ typedef struct { GObject *object; GAsyncReadyCallback callback; gpointer user_data; -} EjectWrapperOp; +} AsyncWrapperOp; static void -eject_wrapper_callback (GObject *source_object, +async_wrapper_callback (GObject *source_object, GAsyncResult *res, gpointer user_data) { - EjectWrapperOp *data = user_data; + AsyncWrapperOp *data = user_data; data->callback (data->object, res, data->user_data); g_object_unref (data->object); g_free (data); } +static AsyncWrapperOp * +setup_async_wrapper (GMount *mount, + GAsyncReadyCallback callback, + gpointer user_data) +{ + AsyncWrapperOp *data; + + data = g_new0 (AsyncWrapperOp, 1); + data->object = g_object_ref (mount); + data->callback = callback; + data->user_data = user_data; + return data; +} + + static void g_proxy_shadow_mount_eject (GMount *mount, GMountUnmountFlags flags, @@ -321,14 +336,13 @@ g_proxy_shadow_mount_eject (GMount *mount, gpointer user_data) { GProxyShadowMount *proxy_shadow_mount = G_PROXY_SHADOW_MOUNT (mount); - EjectWrapperOp *data; + AsyncWrapperOp *data; + data = setup_async_wrapper (mount, callback, user_data); G_LOCK (proxy_shadow_mount); - data = g_new0 (EjectWrapperOp, 1); - data->object = g_object_ref (mount); - data->callback = callback; - data->user_data = user_data; - g_volume_eject (G_VOLUME (proxy_shadow_mount->volume), flags, cancellable, eject_wrapper_callback, data); + g_volume_eject (G_VOLUME (proxy_shadow_mount->volume), + flags, cancellable, + async_wrapper_callback, data); G_UNLOCK (proxy_shadow_mount); } @@ -355,12 +369,13 @@ g_proxy_shadow_mount_unmount (GMount *mount, gpointer user_data) { GProxyShadowMount *proxy_shadow_mount = G_PROXY_SHADOW_MOUNT (mount); + AsyncWrapperOp *data; + data = setup_async_wrapper (mount, callback, user_data); g_mount_unmount (proxy_shadow_mount->real_mount, flags, cancellable, - callback, - user_data); + async_wrapper_callback, data); } static gboolean @@ -383,12 +398,13 @@ g_proxy_shadow_mount_guess_content_type (GMount *mount, gpointer user_data) { GProxyShadowMount *proxy_shadow_mount = G_PROXY_SHADOW_MOUNT (mount); + AsyncWrapperOp *data; + data = setup_async_wrapper (mount, callback, user_data); g_mount_guess_content_type (proxy_shadow_mount->real_mount, force_rescan, cancellable, - callback, - user_data); + async_wrapper_callback, data); } static char ** |