[totem/wip/hadess/bug-fixes: 2/2] backend: Remove X11 dependency



commit 8668fe812762bba32fc75281a248437b9f0efd76
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 7 18:28:03 2019 +0100

    backend: Remove X11 dependency
    
    The missing plugins helper window parenting trick hasn't been used by
    any implementation for a while.
    
    Closes: #220

 meson.build                                        |  1 -
 .../bacon-video-widget-gst-missing-plugins.c       | 68 ----------------------
 src/meson.build                                    |  1 -
 3 files changed, 70 deletions(-)
---
diff --git a/meson.build b/meson.build
index e9266cf2c..9db961cac 100644
--- a/meson.build
+++ b/meson.build
@@ -125,7 +125,6 @@ glib_dep =  dependency('glib-2.0', version: glib_req_version)
 gobject_dep =  dependency('gobject-2.0', version: glib_req_version)
 gio_dep = dependency('gio-2.0', version: '>= 2.43.4')
 gtk_dep = dependency('gtk+-3.0', version: gtk_req_version)
-gdk_x11_dep = dependency('gdk-x11-3.0', version: gtk_req_version)
 gst_dep = dependency('gstreamer-1.0', version: gst_req_version)
 gst_tag_dep = dependency('gstreamer-tag-1.0', version: '>= 0.11.93')
 gst_video_dep = dependency('gstreamer-video-1.0')
diff --git a/src/backend/bacon-video-widget-gst-missing-plugins.c 
b/src/backend/bacon-video-widget-gst-missing-plugins.c
index a604bfc65..79476927a 100644
--- a/src/backend/bacon-video-widget-gst-missing-plugins.c
+++ b/src/backend/bacon-video-widget-gst-missing-plugins.c
@@ -38,10 +38,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 
-#ifdef GDK_WINDOWING_X11
-#include <gtk/gtkx.h>
-#endif
-
 #include <string.h>
 
 GST_DEBUG_CATEGORY_EXTERN (_totem_gst_debug_cat);
@@ -59,53 +55,6 @@ typedef struct
 }
 TotemCodecInstallContext;
 
-#ifdef GDK_WINDOWING_X11
-/* Adapted from totem-interface.c */
-static Window
-bacon_video_widget_gtk_plug_get_toplevel (GtkPlug *plug)
-{
-       Window root, parent, *children;
-       guint nchildren;
-       Window xid;
-
-       g_return_val_if_fail (GTK_IS_PLUG (plug), 0);
-
-       xid = gtk_plug_get_id (plug);
-
-       do
-       {
-               /* FIXME: multi-head */
-               if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xid, &root,
-                                       &parent, &children, &nchildren) == 0)
-               {
-                       g_warning ("Couldn't find window manager window");
-                       return 0;
-               }
-
-               if (root == parent)
-                       return xid;
-
-               xid = parent;
-       }
-       while (TRUE);
-}
-
-static Window
-bacon_video_widget_gst_get_toplevel (GtkWidget *widget)
-{
-       GtkWidget *parent;
-
-       parent = gtk_widget_get_toplevel (GTK_WIDGET (widget));
-       if (parent == NULL)
-               return 0;
-
-       if (GTK_IS_PLUG (parent))
-               return bacon_video_widget_gtk_plug_get_toplevel (GTK_PLUG (parent));
-       else
-               return GDK_WINDOW_XID(gtk_widget_get_window (parent));
-}
-#endif
-
 static gboolean
 bacon_video_widget_gst_codec_install_plugin_is_blacklisted (const gchar * detail)
 {
@@ -256,29 +205,12 @@ bacon_video_widget_start_plugin_installation (TotemCodecInstallContext *ctx,
 {
        GstInstallPluginsContext *install_ctx;
        GstInstallPluginsReturn status;
-#ifdef GDK_WINDOWING_X11
-       GdkDisplay *display;
-#endif
 
        install_ctx = gst_install_plugins_context_new ();
        gst_install_plugins_context_set_desktop_id (install_ctx, "org.gnome.Totem.desktop");
        gst_install_plugins_context_set_confirm_search (install_ctx, confirm_search);
        set_startup_notification_id (install_ctx);
 
-#ifdef GDK_WINDOWING_X11
-       display = gdk_display_get_default ();
-
-       if (GDK_IS_X11_DISPLAY (display) &&
-           gtk_widget_get_window (GTK_WIDGET (ctx->bvw)) != NULL &&
-           gtk_widget_get_realized (GTK_WIDGET (ctx->bvw)))
-       {
-               gulong xid = 0;
-
-               xid = bacon_video_widget_gst_get_toplevel (GTK_WIDGET (ctx->bvw));
-               gst_install_plugins_context_set_xid (install_ctx, xid);
-       }
-#endif /* GDK_WINDOWING_X11 */
-
        status = gst_install_plugins_async ((const char * const*) ctx->details, install_ctx,
                                            on_plugin_installation_done,
                                            ctx);
diff --git a/src/meson.build b/src/meson.build
index 1ad4db15d..478798384 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -57,7 +57,6 @@ totem_common_deps = libbacon_video_widget_deps + python_deps + [
   glib_dep,
   gio_dep,
   gtk_dep,
-  gdk_x11_dep,
   dependency('gmodule-2.0'),
   totem_plparser_dep,
   peas_dep,


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