[gtk/cherry-pick-d13cd9cb] Merge branch 'fix-shell-colorpicker' into 'master'
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/cherry-pick-d13cd9cb] Merge branch 'fix-shell-colorpicker' into 'master'
- Date: Fri, 17 Aug 2018 13:06:45 +0000 (UTC)
commit 0e75d72f28b96a5904dc4ab0ab32a2911ee0ef66
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Aug 17 12:35:46 2018 +0000
Merge branch 'fix-shell-colorpicker' into 'master'
colorpickershell: Unpack the tuple returned from PickColor()
See merge request GNOME/gtk!296
(cherry picked from commit d13cd9cb67f5ab19c4daf49d6749a663bc382d81)
08f32c65 colorpickershell: Unpack the tuple returned from PickColor()
gtk/gtkcolorpickershell.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcolorpickershell.c b/gtk/gtkcolorpickershell.c
index d465e0ab5e..6dfa299c50 100644
--- a/gtk/gtkcolorpickershell.c
+++ b/gtk/gtkcolorpickershell.c
@@ -119,7 +119,7 @@ color_picked (GObject *source,
{
GtkColorPickerShell *picker = GTK_COLOR_PICKER_SHELL (data);
GError *error = NULL;
- GVariant *ret;
+ GVariant *ret, *dict;
ret = g_dbus_proxy_call_finish (picker->shell_proxy, res, &error);
@@ -131,12 +131,15 @@ color_picked (GObject *source,
{
GdkRGBA c;
+ g_variant_get (ret, "(@a{sv})", &dict);
+
c.alpha = 1;
- if (!g_variant_lookup (ret, "color", "(ddd)", &c.red, &c.green, &c.blue))
+ if (!g_variant_lookup (dict, "color", "(ddd)", &c.red, &c.green, &c.blue))
g_task_return_new_error (picker->task, G_IO_ERROR, G_IO_ERROR_FAILED, "No color received");
else
g_task_return_pointer (picker->task, gdk_rgba_copy (&c), (GDestroyNotify)gdk_rgba_free);
+ g_variant_unref (dict);
g_variant_unref (ret);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]