[gtk/matthiasc/for-master] emoji chooser: Fix incremental loading
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master] emoji chooser: Fix incremental loading
- Date: Fri, 4 Dec 2020 16:00:23 +0000 (UTC)
commit 21525fdf34b5c3b6956df043548f764c6e4a9548
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 4 10:58:24 2020 -0500
emoji chooser: Fix incremental loading
This broken when we started using GDK_PROFILER_CURRENT_TIME for
timekeeping - that gets defined to 0 when we're building without
sysprof, so we can use it to make such determinations. Go back
to using g_get_monotonic_time().
gtk/gtkemojichooser.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c
index d5ec763936..a41c4b49d5 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -672,7 +672,7 @@ populate_emoji_chooser (gpointer data)
GVariant *item;
gint64 start, now;
- start = GDK_PROFILER_CURRENT_TIME;
+ start = g_get_monotonic_time ();
if (!chooser->data)
{
@@ -718,10 +718,10 @@ populate_emoji_chooser (gpointer data)
add_emoji (chooser->box, FALSE, item, 0, chooser);
g_variant_unref (item);
- now = GDK_PROFILER_CURRENT_TIME;
- if (now > start + 2000000) /* 2 ms */
+ now = g_get_monotonic_time ();
+ if (now > start + 200) /* 2 ms */
{
- gdk_profiler_add_mark (start, (now - start), "emojichooser", "populate");
+ gdk_profiler_add_mark (start * 1000, (now - start) * 1000, "emojichooser", "populate");
return G_SOURCE_CONTINUE;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]