summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-09-14 21:09:45 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-09-14 21:09:45 +0200
commit9e440acabc7fec6f414582fd8e1ef45268cb0731 (patch)
tree946b14d16aae2681ea7c28073a910645cef503f1 /plugins
parent191c997f2aef31ffab57be2915a977fd2a50549d (diff)
gtkui: increased widget buffers
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/gtkui.c73
-rw-r--r--plugins/gtkui/widgets.c11
2 files changed, 43 insertions, 41 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index a1304eff..87264853 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -905,7 +905,7 @@ init_widget_layout (void) {
gtk_box_pack_start (GTK_BOX(lookup_widget(mainwin, "plugins_bottom_vbox")), rootwidget->widget, TRUE, TRUE, 0);
// load layout
- char layout[4000];
+ char layout[20000];
deadbeef->conf_get_str ("gtkui.layout", "tabbed_playlist \"\" { }", layout, sizeof (layout));
ddb_gtkui_widget_t *w = NULL;
@@ -922,6 +922,40 @@ init_widget_layout (void) {
static DB_plugin_t *supereq_plugin;
+gboolean
+gtkui_connect_cb (void *none) {
+ // equalizer
+ GtkWidget *eq_mi = lookup_widget (mainwin, "view_eq");
+ if (!supereq_plugin) {
+ gtk_widget_hide (GTK_WIDGET (eq_mi));
+ }
+ else {
+ if (deadbeef->conf_get_int ("gtkui.eq.visible", 0)) {
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), TRUE);
+ eq_window_show ();
+ }
+ else {
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), FALSE);
+ }
+ }
+
+ // cover_art
+ DB_plugin_t **plugins = deadbeef->plug_get_list ();
+ for (int i = 0; plugins[i]; i++) {
+ DB_plugin_t *p = plugins[i];
+ if (p->id && !strcmp (p->id, "artwork")) {
+ trace ("gtkui: found cover-art loader plugin\n");
+ coverart_plugin = (DB_artwork_plugin_t *)p;
+ break;
+ }
+ }
+ gtkui_playlist_changed ();
+ add_mainmenu_actions ();
+ ddb_event_t *e = deadbeef->event_alloc (DB_EV_TRACKINFOCHANGED);
+ deadbeef->event_send(e, 0, 0);
+ return FALSE;
+}
+
void
gtkui_thread (void *ctx) {
#ifdef __linux__
@@ -1116,9 +1150,8 @@ gtkui_thread (void *ctx) {
deadbeef->plt_load = gtkui_plt_load;
supereq_plugin = deadbeef->plug_get_for_id ("supereq");
- // need to do it in gtk thread
- gtkui_connect_cb (NULL);
+ gtkui_connect_cb (NULL);
gtk_main ();
@@ -1291,40 +1324,6 @@ gtkui_start (void) {
return 0;
}
-gboolean
-gtkui_connect_cb (void *none) {
- // equalizer
- GtkWidget *eq_mi = lookup_widget (mainwin, "view_eq");
- if (!supereq_plugin) {
- gtk_widget_hide (GTK_WIDGET (eq_mi));
- }
- else {
- if (deadbeef->conf_get_int ("gtkui.eq.visible", 0)) {
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), TRUE);
- eq_window_show ();
- }
- else {
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (eq_mi), FALSE);
- }
- }
-
- // cover_art
- DB_plugin_t **plugins = deadbeef->plug_get_list ();
- for (int i = 0; plugins[i]; i++) {
- DB_plugin_t *p = plugins[i];
- if (p->id && !strcmp (p->id, "artwork")) {
- trace ("gtkui: found cover-art loader plugin\n");
- coverart_plugin = (DB_artwork_plugin_t *)p;
- break;
- }
- }
- gtkui_playlist_changed ();
- add_mainmenu_actions ();
- ddb_event_t *e = deadbeef->event_alloc (DB_EV_TRACKINFOCHANGED);
- deadbeef->event_send(e, 0, 0);
- return FALSE;
-}
-
static int
gtkui_connect (void) {
return 0;
diff --git a/plugins/gtkui/widgets.c b/plugins/gtkui/widgets.c
index 7864b24f..b6efd3e9 100644
--- a/plugins/gtkui/widgets.c
+++ b/plugins/gtkui/widgets.c
@@ -46,6 +46,9 @@
// utility code for parsing keyvalues
#define get_keyvalue(s,key,val) {\
s = gettoken_ext (s, key, "={}();");\
+ if (!s) {\
+ return NULL;\
+ }\
if (s && !strcmp (key, "{")) {\
break;\
}\
@@ -371,7 +374,7 @@ w_draw_event (GtkWidget *widget, cairo_t *cr, gpointer user_data) {
GtkAllocation allocation;
gtk_widget_get_allocation (widget, &allocation);
#if GTK_CHECK_VERSION(3,0,0)
- cairo_translate (cr, -allocation.x, -allocation.y);
+ //cairo_translate (cr, -allocation.x, -allocation.y);
#endif
cairo_set_source_rgb (cr, 0.17f, 0, 0.83f);
@@ -396,7 +399,7 @@ w_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer user_data) {
return res;
}
-static char paste_buffer[1000];
+static char paste_buffer[20000];
void
save_widget_to_string (char *str, int sz, ddb_gtkui_widget_t *w) {
@@ -413,7 +416,7 @@ save_widget_to_string (char *str, int sz, ddb_gtkui_widget_t *w) {
void
w_save (void) {
- char buf[4000] = "";
+ char buf[20000] = "";
save_widget_to_string (buf, sizeof (buf), rootwidget->children);
deadbeef->conf_set_str ("gtkui.layout", buf);
deadbeef->conf_save ();
@@ -1160,7 +1163,7 @@ on_move_tab_left_activate (GtkMenuItem *menuitem, gpointer user_data) {
ddb_gtkui_widget_t *prev = NULL;
for (ddb_gtkui_widget_t *c = w->base.children; c; c = c->next, i++) {
if (i == w->clicked_page) {
- char buf[4000] = "";
+ char buf[20000] = "";
save_widget_to_string (buf, sizeof (buf), c);
w_create_from_string (buf, &newchild);