summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-05-11 18:40:33 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-05-11 18:40:33 +0200
commit7acc533a95ced8d6f8fa6ef85035806e64ad089a (patch)
tree7c82d3e78de8b1c8308b51e9025184d9da8755ba /plugins/gtkui
parentede2c2dac51b86b9797e7ddb89cf534dc0d5c185 (diff)
gtkui: restored the accidentally deleted double-click status bar handler
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/callbacks.c18
-rw-r--r--plugins/gtkui/callbacks.h5
-rw-r--r--plugins/gtkui/deadbeef.glade1
-rw-r--r--plugins/gtkui/interface.c3
4 files changed, 27 insertions, 0 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index 4cb77434..3ca754bf 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -571,6 +571,24 @@ on_new_playlist1_activate (GtkMenuItem *menuitem,
action_new_playlist_handler_cb (NULL);
}
+gboolean
+on_mainwin_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ GtkWidget *statusbar = lookup_widget (mainwin, "statusbar");
+ GtkAllocation c;
+ gtk_widget_get_allocation (statusbar, &c);
+ if (event->x >= c.x && event->x < c.x + c.width
+ && event->y >= c.y && event->y < c.y + c.height) {
+ if (event->type == GDK_2BUTTON_PRESS) {
+ deadbeef->sendmessage (DB_EV_TRACKFOCUSCURRENT, 0, 0, 0);
+ }
+ }
+
+ return FALSE;
+}
+
GtkWidget*
create_seekbar (gchar *widget_name, gchar *string1, gchar *string2,
diff --git a/plugins/gtkui/callbacks.h b/plugins/gtkui/callbacks.h
index a11b104d..23745f0f 100644
--- a/plugins/gtkui/callbacks.h
+++ b/plugins/gtkui/callbacks.h
@@ -1296,3 +1296,8 @@ on_stop_after_album_activate (GtkMenuItem *menuitem,
void
on_reset_autostopalbum_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
+
+gboolean
+on_mainwin_button_press_event (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data);
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index 949a816c..7641ed20 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -27,6 +27,7 @@
<signal name="configure_event" handler="on_mainwin_configure_event" last_modification_time="Sun, 23 Aug 2009 15:26:53 GMT"/>
<signal name="window_state_event" handler="on_mainwin_window_state_event" last_modification_time="Wed, 09 Dec 2009 19:39:55 GMT"/>
<signal name="realize" handler="on_mainwin_realize" last_modification_time="Wed, 10 Mar 2010 18:20:51 GMT"/>
+ <signal name="button_press_event" handler="on_mainwin_button_press_event" last_modification_time="Sun, 11 May 2014 16:38:17 GMT"/>
<child>
<widget class="GtkVBox" id="vbox1">
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index d1c9f9f2..f73a1c55 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -476,6 +476,9 @@ create_mainwin (void)
g_signal_connect ((gpointer) mainwin, "realize",
G_CALLBACK (on_mainwin_realize),
NULL);
+ g_signal_connect ((gpointer) mainwin, "button_press_event",
+ G_CALLBACK (on_mainwin_button_press_event),
+ NULL);
g_signal_connect ((gpointer) open, "activate",
G_CALLBACK (on_open_activate),
NULL);