[gtk/wip/chergert/gtk4-gtk-main-sync: 1/2] gtkmain: short-circuit gtk_main_sync() where no display
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gtk4-gtk-main-sync: 1/2] gtkmain: short-circuit gtk_main_sync() where no display
- Date: Fri, 10 Jan 2020 23:06:32 +0000 (UTC)
commit 4a7f68e79e0c2a56eb1297e72a33cbdcd68418ba
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 10 15:00:10 2020 -0800
gtkmain: short-circuit gtk_main_sync() where no display
If there is no display, we will hit the slow path here which
can introduce long latencies in unit tests. This checks for
a NULL list of displays and simply short-circuits.
gtk/gtkmain.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index fe5868a95d..93fea8540a 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1081,6 +1081,9 @@ gtk_main_sync (void)
/* Try storing all clipboard data we have */
displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
+ if (displays == NULL)
+ return;
+
cancel = g_cancellable_new ();
for (l = displays; l; l = l->next)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]