summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2013-08-25 16:42:52 +0200
committerGravatar waker <wakeroid@gmail.com>2013-08-25 16:42:52 +0200
commit5802fcec75b58a270a9459fb26a606af018adaf0 (patch)
treefd2b4f1ce9f34993a136e0ec121a1ed36f2ee494
parent78bf40fc922fdb1f6d5b3e7a511ed589a37a5a26 (diff)
gtkui: fixed hotkeys vs focus problem; updated help.txt
-rw-r--r--help.txt4
-rw-r--r--plugins/gtkui/callbacks.c20
-rw-r--r--plugins/gtkui/deadbeef.glade2
-rw-r--r--plugins/gtkui/interface.c6
4 files changed, 25 insertions, 7 deletions
diff --git a/help.txt b/help.txt
index 8427fbdd..c82cb295 100644
--- a/help.txt
+++ b/help.txt
@@ -14,9 +14,7 @@ help file for deadbeef player
playlist can be navigated with arrow keys, as well as PgUp, PgDn, Home, End, etc.
use above with Shift key to select multiple tracks.
- you can change, remove or add any key mappings in the Edit->Preferences->Hotkeys tab.
-
- since version 0.6, the Winamp™-style hotkeys are no longer assigned by default, because it may cause issues with widgets that expect input using these keys.
+ you can view, change, remove or add any key mappings in the Edit->Preferences->Hotkeys tab.
* CONFIGURATION
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index 4bec4c8e..c1f09515 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -199,6 +199,26 @@ on_mainwin_key_press_event (GtkWidget *widget,
mods |= Mod4Mask;
}
trace ("keycode: %x, mods %x\n", event->keyval, mods);
+
+#if 0
+ // only execute actions if one of playlist widgets is in focus, or none
+ GtkWidget *focus = gtk_window_get_focus (GTK_WINDOW (mainwin));
+ if (focus) {
+ GtkWidget *parent = gtk_widget_get_parent (focus);
+ if (!parent) {
+ return FALSE;
+ }
+ parent = gtk_widget_get_parent (parent);
+ if (!parent) {
+ return FALSE;
+ }
+ parent = gtk_widget_get_parent (parent);
+ if (!parent || !DDB_IS_LISTVIEW (parent)) {
+ return FALSE;
+ }
+ }
+#endif
+
DB_plugin_t *hkplug = deadbeef->plug_get_for_id ("hotkeys");
if (hkplug) {
int ctx;
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index c84d5f6b..5616dd34 100644
--- a/plugins/gtkui/deadbeef.glade
+++ b/plugins/gtkui/deadbeef.glade
@@ -22,7 +22,7 @@
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
- <signal name="key_press_event" handler="on_mainwin_key_press_event" last_modification_time="Thu, 30 Jul 2009 21:14:26 GMT"/>
+ <signal name="key_press_event" handler="on_mainwin_key_press_event" after="yes" last_modification_time="Thu, 30 Jul 2009 21:14:26 GMT"/>
<signal name="delete_event" handler="on_mainwin_delete_event" last_modification_time="Thu, 13 Aug 2009 20:35:55 GMT"/>
<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"/>
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index e8dc2e3b..7338c732 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -553,9 +553,9 @@ create_mainwin (void)
gtk_widget_show (statusbar);
gtk_box_pack_start (GTK_BOX (vbox1), statusbar, FALSE, FALSE, 0);
- g_signal_connect ((gpointer) mainwin, "key_press_event",
- G_CALLBACK (on_mainwin_key_press_event),
- NULL);
+ g_signal_connect_after ((gpointer) mainwin, "key_press_event",
+ G_CALLBACK (on_mainwin_key_press_event),
+ NULL);
g_signal_connect ((gpointer) mainwin, "delete_event",
G_CALLBACK (on_mainwin_delete_event),
NULL);