[gtk/gtk-3-24: 1/2] Avoid Broadwayd - GtkEntry popup takes 35s after application startup



commit edd490cf4d3cf4a388f79785ce60b544ddc412de
Author: Fredy Paquet <fredy opag ch>
Date:   Fri Nov 22 14:33:56 2019 +0100

    Avoid Broadwayd - GtkEntry popup takes 35s after application startup
    
    preventing conversion attempt and timer being started on broadway
    backend.
    
    first iteration for #1630
    
    Author:    Fredy Paquet <fredy opag ch>
    Signed-off-by: Aurélien Pupier <apupier redhat com>

 gtk/gtkselection.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
---
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index b976d19845..32d9de88bf 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -112,6 +112,10 @@
 #include <gdk/wayland/gdkwayland.h>
 #endif
 
+#ifdef GDK_WINDOWING_BROADWAY
+#include "broadway/gdkbroadway.h"
+#endif
+
 #undef DEBUG_SELECTION
 
 /* Maximum size of a sent chunk, in bytes. Also the default size of
@@ -1180,6 +1184,25 @@ gtk_selection_convert (GtkWidget *widget,
          return TRUE;
        }
     }
+
+#if defined GDK_WINDOWING_BROADWAY
+  /* This patch is a workaround to circumvent unimplemented
+     clipboard functionality in broadwayd. It eliminates
+     35s delay on popup menu before first clipboard copy,
+     by preventing conversion to be started.
+   
+     https://gitlab.gnome.org/GNOME/gtk/issues/1630
+  */ 
+  if (GDK_IS_BROADWAY_DISPLAY (display))
+  {
+      g_debug("gtk_selection_convert: disabled for broadway backend");
+
+      gtk_selection_retrieval_report (
+          info, GDK_NONE, 0, NULL, -1, GDK_CURRENT_TIME);
+
+      return FALSE;
+  }
+#endif
   
   /* Otherwise, we need to go through X */
   


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]