[recipes/recipes-1.0] Make exporting work with recent GTK+



commit e52e9de544aa3f7faff8f132ac825f8c0729fdcb
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue May 16 22:33:58 2017 -0400

    Make exporting work with recent GTK+
    
    The wayland handle export function in GTK+ got a little
    stricter about freeing its user data, recently. This
    was causing us to crash. Fix that by not adding an extra
    idle here.

 src/gr-utils.c |   20 +++-----------------
 1 files changed, 3 insertions(+), 17 deletions(-)
---
diff --git a/src/gr-utils.c b/src/gr-utils.c
index 5a00fe9..d80cac3 100644
--- a/src/gr-utils.c
+++ b/src/gr-utils.c
@@ -510,17 +510,6 @@ free_exported_data (gpointer data)
         g_free (d);
 }
 
-static gboolean
-handle_exported_idle (gpointer user_data)
-{
-        WaylandWindowHandleExportedData *data = user_data;
-
-        data->callback (data->window, data->handle_str, data->user_data);
-        free_exported_data (data);
-
-        return G_SOURCE_REMOVE;
-}
-
 static void
 wayland_window_handle_exported (GdkWindow  *window,
                                 const char *wayland_handle_str,
@@ -529,7 +518,7 @@ wayland_window_handle_exported (GdkWindow  *window,
         WaylandWindowHandleExportedData *data = user_data;
 
         data->handle_str = g_strdup_printf ("wayland:%s", wayland_handle_str);
-        g_idle_add (handle_exported_idle, data);
+        data->callback (data->window, data->handle_str, data->user_data);
 }
 #endif
 
@@ -563,13 +552,10 @@ window_export_handle (GtkWindow            *window,
                 if (!gdk_wayland_window_export_handle (gdk_window,
                                                        wayland_window_handle_exported,
                                                        data,
-                                                       free_exported_data)) {
-                        free_exported_data (data);
+                                                       free_exported_data))
                         return FALSE;
-                }
-                else {
+                else
                         return TRUE;
-                }
         }
 #endif
 


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