[totem] Revert "main: Add guards for XInitThreads() calls"



commit 07ec4f18ac677e450eea82d3ee80a04271b6cfa3
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Mar 29 11:47:46 2012 +0200

    Revert "main: Add guards for XInitThreads() calls"
    
    This reverts commit 26a564c99a4dd414ee4014e524e371188769a4e6.
    
    We can't optionally call XInitThreads(). We need to call it before
    making any single call to X11 API, which GTK+ would already have
    done if we had a display opened. As it doesn't actually require
    X11, just the library to setup the locking, let it do that.

 src/backend/bvw-test.c |    7 +------
 src/totem.c            |    8 +-------
 2 files changed, 2 insertions(+), 13 deletions(-)
---
diff --git a/src/backend/bvw-test.c b/src/backend/bvw-test.c
index d24ddfa..0f6b3a5 100644
--- a/src/backend/bvw-test.c
+++ b/src/backend/bvw-test.c
@@ -5,7 +5,6 @@
 #include <gdk/gdk.h>
 #include "bacon-video-widget.h"
 #ifdef GDK_WINDOWING_X11
-#include <gdk/gdkx.h>
 #include <X11/Xlib.h>
 #endif
 
@@ -79,11 +78,7 @@ int main
 	GtkWidget *win, *bvw;
 
 #ifdef GDK_WINDOWING_X11
-	GdkDisplay *display;
-
-	display = gdk_display_get_default ();
-	if (GDK_IS_X11_DISPLAY (display))
-		XInitThreads ();
+	XInitThreads ();
 #endif
 
 	context = g_option_context_new ("- Play audio and video inside a web browser");
diff --git a/src/totem.c b/src/totem.c
index 866700a..1222cda 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -36,7 +36,6 @@
 
 #ifdef GDK_WINDOWING_X11
 /* X11 headers */
-#include <gdk/gdkx.h>
 #include <X11/Xlib.h>
 #endif
 
@@ -229,18 +228,13 @@ main (int argc, char **argv)
 {
 	Totem *totem;
 	GtkSettings *gtk_settings;
-#ifdef GDK_WINDOWING_X11
-	GdkDisplay *display;
-#endif
 
 	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
 #ifdef GDK_WINDOWING_X11
-	display = gdk_display_get_default ();
-	if (GDK_IS_X11_DISPLAY (display) &&
-	    XInitThreads () == 0)
+	if (XInitThreads () == 0)
 	{
 		gtk_init (&argc, &argv);
 		g_set_application_name (_("Totem Movie Player"));



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