From 5802fcec75b58a270a9459fb26a606af018adaf0 Mon Sep 17 00:00:00 2001 From: waker Date: Sun, 25 Aug 2013 16:42:52 +0200 Subject: gtkui: fixed hotkeys vs focus problem; updated help.txt --- help.txt | 4 +--- plugins/gtkui/callbacks.c | 20 ++++++++++++++++++++ plugins/gtkui/deadbeef.glade | 2 +- plugins/gtkui/interface.c | 6 +++--- 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 @@ GDK_GRAVITY_NORTH_WEST True False - + 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); -- cgit v1.2.3