[rhythmbox] main: fix initial gdk lock state



commit 84e673d4fc71b6771fa2da64fa1b3f8b185f946b
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Jan 14 11:37:43 2012 +1000

    main: fix initial gdk lock state
    
    With glib < 2.31, we need to take the gdk lock before
    g_application_run, but with glib >= 2.31, we can't.
    Now we use glib_check_version to figure out what to do at runtime.

 shell/main.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/shell/main.c b/shell/main.c
index 6c6db54..b3da7ed 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -86,7 +86,9 @@ main (int argc, char **argv)
 
 	/* TODO: kill this function */
 	rb_threads_init ();
-	gdk_threads_enter ();
+	if (glib_check_version (2, 31, 1) != NULL) {
+		gdk_threads_enter ();
+	}
 
 	new_argc = argc;
 	new_argv = argv;
@@ -96,7 +98,9 @@ main (int argc, char **argv)
 
 	g_object_unref (shell);
 
-	gdk_threads_leave ();
+	if (glib_check_version (2, 31, 1) != NULL) {
+		gdk_threads_leave ();
+	}
 
 	exit (0);
 }



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