diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-12-16 21:28:52 +0100 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-12-16 21:29:03 +0100 |
commit | 1daab59225202c7f17679a8570dd19e744c5c36b (patch) | |
tree | 1e70cc7fc312d4afdaa3f56bbb5e8a5d5f2a6ac0 /plugins/gtkui/gtkui.c | |
parent | 85348e09449ca64ecf099477520e99a66e608137 (diff) |
gtkui, hotkeys: fix running without X (bug #1023)
Diffstat (limited to 'plugins/gtkui/gtkui.c')
-rw-r--r-- | plugins/gtkui/gtkui.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 906f4393..602d0df8 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -779,7 +779,7 @@ add_mainmenu_actions_cb (void *data) { return FALSE; } -void +int gtkui_thread (void *ctx); int @@ -940,13 +940,18 @@ gtkui_add_file_end_cb (ddb_fileadd_data_t *data, void *user_data) { } } -void +int 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); |