diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-02 19:01:27 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-02-02 19:01:27 +0100 |
commit | 8eb91d5291783d403a95c0a98dccbc2c9d870719 (patch) | |
tree | 0332d09b4aa329f2baea58a70e69815d1feff401 /plugins/gtkui/gtkui.c | |
parent | ced846a5b1accbf66a9e24adf823cad9145edcdb (diff) |
gtkui: minor code cleanup + restored calling gdk_threads_init
Diffstat (limited to 'plugins/gtkui/gtkui.c')
-rw-r--r-- | plugins/gtkui/gtkui.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 320422e5..bb89b17d 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -947,17 +947,6 @@ gtkui_thread (void *ctx) { #ifdef __linux__ prctl (PR_SET_NAME, "deadbeef-gtkui", 0, 0, 0, 0); #endif -#ifndef __APPLE__ - XInitThreads (); // gtkglext/xcb doesn't work without this - Display *disp = XOpenDisplay (NULL); - if (!disp) { - return -1; - } - XCloseDisplay (disp); -#endif - // let's start some gtk - g_thread_init (NULL); - add_pixmap_directory (deadbeef->get_pixmap_dir ()); int argc = 2; const char **argv = alloca (sizeof (char *) * argc); @@ -969,7 +958,16 @@ gtkui_thread (void *ctx) { } gtk_disable_setlocale (); + add_pixmap_directory (deadbeef->get_pixmap_dir ()); + // let's start some gtk + g_thread_init (NULL); +#ifndef __FreeBSD__ + // this call makes gtk_main hang on freebsd for unknown reason + // however, if we don't have this call, deadbeef will crash randomly on + // gentoo linux + gdk_threads_init (); +#endif gtk_init (&argc, (char ***)&argv); // register widget types |