summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-09-11 22:02:03 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2013-09-11 22:02:03 +0200
commit1d1c644027bb9263ed154a2aa257941624af4c38 (patch)
tree484a61b83926e6ecd12048a7fc094bebe8163071 /plugins/gtkui
parentdfecc118a2268338a5699b9723812d606d648915 (diff)
osx: make hotkeys working
as a side effect, hotkeys plugin will now be built even if Xlib is not available, so localhotkeys will always work
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/callbacks.c31
-rw-r--r--plugins/gtkui/hotkeys.c4
2 files changed, 5 insertions, 30 deletions
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index 55c3e598..507fab38 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -185,42 +185,22 @@ on_mainwin_key_press_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
-#ifndef __APPLE__
// local hotkeys
// first translate gdk modifiers into X11 constants
int mods = 0;
if (event->state & GDK_CONTROL_MASK) {
- mods |= ControlMask;
+ mods |= GDK_CONTROL_MASK;
}
if (event->state & GDK_MOD1_MASK) {
- mods |= Mod1Mask;
+ mods |= GDK_MOD1_MASK;
}
if (event->state & GDK_SHIFT_MASK) {
- mods |= ShiftMask;
+ mods |= GDK_SHIFT_MASK;
}
if (event->state & GDK_MOD4_MASK) {
- mods |= Mod4Mask;
+ mods |= GDK_MOD4_MASK;
}
- 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
+ trace ("pressed: keycode: %x, mods %x\n", event->keyval, mods);
DB_plugin_t *hkplug = deadbeef->plug_get_for_id ("hotkeys");
if (hkplug) {
@@ -233,7 +213,6 @@ on_mainwin_key_press_event (GtkWidget *widget,
}
}
trace ("action not found\n");
-#endif
return FALSE;
}
diff --git a/plugins/gtkui/hotkeys.c b/plugins/gtkui/hotkeys.c
index a34fb629..6e710f4a 100644
--- a/plugins/gtkui/hotkeys.c
+++ b/plugins/gtkui/hotkeys.c
@@ -609,11 +609,7 @@ typedef struct {
#define KEY(kname, kcode) { .name=kname, .keysym=kcode },
static const xkey_t keys[] = {
-#ifndef __APPLE__
#include "../hotkeys/keysyms.inc"
-#else
- { .name=NULL, .keysym=0 }
-#endif
};
static const char *