[Wayland-bugs] [Bug 786693] wayland: fix fontconfig monitoring

gtk+ (GNOME Bugzilla) bugzilla at gnome.org
Tue Feb 27 09:47:36 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=786693

Bastien Nocera <bugzilla at hadess.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #368982|none                        |needs-work
             status|                            |

--- Comment #8 from Bastien Nocera <bugzilla at hadess.net> ---
Review of attachment 368982:

Thanks for looking into this again, we're nearly there.

It also looks easy enough to extend and add support for the 2 other GtkSettings
if you're interested.

::: gdk/wayland/gdkscreen-wayland.c
@@ +70,3 @@
   GHashTable *settings;
   GsdXftSettings xft_settings;
+  GsdFcSettings fc_settings;

Why use a struct here, and not directly a timestamp? The struct will be
initialised to 0 when it's instantiated.

@@ +116,3 @@

+  if (screen_wayland->dbus_proxy)
+    g_object_unref (screen_wayland->dbus_proxy);

You can replace both lines with g_clear_object();

@@ +713,3 @@
+  if (strcmp (name, "gtk-fontconfig-timestamp") == 0)
+    {
+      if (wayland_screen->fc_settings.timestamp > 0)

Why the guard here? Wouldn't you want to return the "0" instead of an error
here?

@@ +872,3 @@
+    return;
+
+  g_variant_get (changed_properties, "a{sv}", &iter);

You can replace this loop with g_variant_lookup_value()
Don't forget to exit early if the timestamp wasn't found.

@@ +914,3 @@
+  if (proxy == NULL)
+    {
+      g_clear_error (&error);

Either you should not use an error at all (you don't do anything with it), or
you should have a few cases and print errors if the error is something other
than the call being cancelled, or org.gtk.Settings not existing.

@@ +969,3 @@
+                            GTK_SETTINGS_DBUS_PATH,
+                            GTK_SETTINGS_DBUS_NAME,
+                            NULL,

You'll also want to add a cancellable here, which you would cancel and destroy
in the finalize function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20180227/ea4587f7/attachment.html>


More information about the wayland-bugs mailing list