summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2019-08-13 17:26:27 +0200
committerHans de Goede <hdegoede@redhat.com>2019-08-13 17:37:33 +0200
commit771fba737b9094fb19dab5158b39b39c6986602c (patch)
tree537142c91279a23195b02a4e8430c56beb06a55c
parent0402e60e40694c86714a1f3def8673c52b9f1b59 (diff)
downloadgnome-settings-daemon-771fba737b9094fb19dab5158b39b39c6986602c.tar.gz
media-keys: Fix MprisController no longer working
Since commit e4297f2ae ("media-keys: Use G_DECLARE_FINAL_TYPE for MprisController"), the MPRIS support in g-s-d no longer works. This is caused by the mpris_proxy_ready_cb changes, after the troublesome commit, the MprisController self pointer is retreived by the mpris_proxy_ready_cb like this: MprisController *self = MPRIS_CONTROLLER (object); But the object parameter to the GAsyncReadyCallback is the source object, which in this case is the just created GDBusProxy, not our MprisController object, leading to these warnings: gsd-media-keys[x]: invalid cast from 'GDBusProxy' to 'MprisController' Our MprisController is passed through the user_data pointer, so this commit fixes the code to use this instead. This fixes the warning and more importantly also makes the MPRIS support work again, since it now will now properly set self->mpris_client_proxy again. Fixes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/437
-rw-r--r--plugins/media-keys/mpris-controller.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/media-keys/mpris-controller.c b/plugins/media-keys/mpris-controller.c
index ac839f52..a1d19e30 100644
--- a/plugins/media-keys/mpris-controller.c
+++ b/plugins/media-keys/mpris-controller.c
@@ -122,7 +122,7 @@ mpris_proxy_ready_cb (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
- MprisController *self = MPRIS_CONTROLLER (object);
+ MprisController *self = MPRIS_CONTROLLER (user_data);
GError *error = NULL;
GDBusProxy *proxy;