[rhythmbox] Don't run gdk_x11_* functions unless running on X11



commit d97dcd0d2051c80ad6166c54c5fced1e1396ee3f
Author: Armin K <krejzi email com>
Date:   Thu Nov 21 16:12:38 2013 +0100

    Don't run gdk_x11_* functions unless running on X11
    
    GDK on Linux can be compiled with multiple backends,
    so it is not enough to add build time checks for
    backend support, but also runtime checks.

 lib/rb-missing-plugins.c                           |    8 +++++---
 .../rb-disc-recorder-plugin.c                      |    8 ++++----
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/lib/rb-missing-plugins.c b/lib/rb-missing-plugins.c
index dfa464c..acf7e3e 100644
--- a/lib/rb-missing-plugins.c
+++ b/lib/rb-missing-plugins.c
@@ -213,9 +213,11 @@ rb_missing_plugins_install (const char **details, gboolean ignore_blacklist, GCl
 
        if (parent_window != NULL && gtk_widget_get_realized (GTK_WIDGET (parent_window))) {
 #ifdef GDK_WINDOWING_X11
-               gulong xid = 0;
-               xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (parent_window)));
-               gst_install_plugins_context_set_xid (install_ctx, xid);
+               if (GDK_IS_X11_WINDOW (gtk_widget_get_window (GTK_WIDGET (parent_window)))) {
+                       gulong xid = 0;
+                       xid = gdk_x11_window_get_xid (gtk_widget_get_window (GTK_WIDGET (parent_window)));
+                       gst_install_plugins_context_set_xid (install_ctx, xid);
+               }
 #endif
        }
 
diff --git a/plugins/brasero-disc-recorder/rb-disc-recorder-plugin.c 
b/plugins/brasero-disc-recorder/rb-disc-recorder-plugin.c
index 6dbe8d8..8608e84 100644
--- a/plugins/brasero-disc-recorder/rb-disc-recorder-plugin.c
+++ b/plugins/brasero-disc-recorder/rb-disc-recorder-plugin.c
@@ -39,7 +39,9 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <glib/gstdio.h>
+#ifdef GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
+#endif
 #include <brasero-media.h>
 #include <brasero-medium-monitor.h>
 
@@ -127,7 +129,7 @@ rb_disc_recorder_plugin_start_burning (RBDiscRecorderPlugin *pi,
        GtkWidget *main_window;
        GdkWindow *window;
        GPtrArray *array;
-       char **args, *xid_str;
+       char **args, *xid_str = NULL;
        GError *error = NULL;
        gboolean ret;
        RBShell *shell;
@@ -145,14 +147,12 @@ rb_disc_recorder_plugin_start_burning (RBDiscRecorderPlugin *pi,
        g_object_unref (shell);
 
        window = gtk_widget_get_window (main_window);
-       if (window) {
+       if (window && GDK_IS_X11_WINDOW (window)) {
                int xid;
                xid = gdk_x11_window_get_xid (window);
                xid_str = g_strdup_printf ("%d", xid);
                g_ptr_array_add (array, "-x");
                g_ptr_array_add (array, xid_str);
-       } else {
-               xid_str = NULL;
        }
        
        g_ptr_array_add (array, NULL);


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