summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-12-10 21:09:10 +0100
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-12-10 21:09:10 +0100
commitc9f59e3b47ee5fd029d73c92d561d1688d7a5210 (patch)
treef39539775e02bc037081bd783d2c9d96eb0af43d
parentea34b654fff75e19809eecf378826813c73a7e94 (diff)
gtkui: don't accept messages before GTK finishes initializing
-rw-r--r--plugins/gtkui/gtkui.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index dc6eeb1f..906f4393 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -79,6 +79,8 @@ GtkWidget *traymenu;
GtkWidget *theme_treeview;
GtkWidget *theme_button;
+static int gtkui_accept_messages = 0;
+
int fileadded_listener_id;
int fileadd_beginend_listener_id;
// overriden API methods
@@ -797,6 +799,9 @@ gtkui_plt_load (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, in
int
gtkui_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
+ if (!gtkui_accept_messages) {
+ return -1;
+ }
ddb_gtkui_widget_t *rootwidget = w_get_rootwidget ();
if (rootwidget) {
send_messages_to_widgets (rootwidget, id, ctx, p1, p2);
@@ -1084,6 +1089,8 @@ gtkui_thread (void *ctx) {
supereq_plugin = deadbeef->plug_get_for_id ("supereq");
gtkui_connect_cb (NULL);
+
+ gtkui_accept_messages = 1;
deadbeef->sendmessage (DB_EV_PLAYLISTCHANGED, 0, 0, 0);
#ifdef __APPLE__