summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/Makefile.am8
-rw-r--r--plugins/gtkui/ddblistview.c43
-rw-r--r--plugins/gtkui/deadbeef.glade4
-rw-r--r--plugins/gtkui/interface.c12
-rw-r--r--plugins/gtkui/search.c13
5 files changed, 44 insertions, 36 deletions
diff --git a/plugins/gtkui/Makefile.am b/plugins/gtkui/Makefile.am
index d7f6fcc9..8495bd55 100644
--- a/plugins/gtkui/Makefile.am
+++ b/plugins/gtkui/Makefile.am
@@ -13,9 +13,9 @@ gtkuidir = $(libdir)/$(PACKAGE)
#endif
#endif
-#if OS_OSX
-#OSXSRC = retina.m
-#endif
+if OS_OSX
+osx_sources = retina.m
+endif
GTKUI_SOURCES = gtkui.c gtkui.h\
callbacks.c interface.c support.c callbacks.h interface.h support.h\
@@ -161,7 +161,7 @@ ddb_gui_GTK2_la_CFLAGS = -std=c99 $(GTK2_DEPS_CFLAGS) $(SM_CFLAGS) $(GTKGLEXT_CF
endif
if HAVE_GTK3
-GTKUI_SOURCES_GTK3 = $(GTKUI_SOURCES)
+GTKUI_SOURCES_GTK3 = $(GTKUI_SOURCES) $(osx_sources)
# gtkglext-gtk3/gtk/gtkglinit.c\
# gtkglext-gtk3/gtk/gtkglversion.c\
diff --git a/plugins/gtkui/ddblistview.c b/plugins/gtkui/ddblistview.c
index e5e5d584..2234643d 100644
--- a/plugins/gtkui/ddblistview.c
+++ b/plugins/gtkui/ddblistview.c
@@ -204,6 +204,9 @@ ddb_listview_list_button_press_event (GtkWidget *widget,
gpointer user_data);
gboolean
+ddb_listview_list_popup_menu (GtkWidget *widget, gpointer user_data);
+
+gboolean
ddb_listview_list_drag_motion (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
@@ -446,6 +449,9 @@ ddb_listview_init(DdbListview *listview)
g_signal_connect_after ((gpointer) listview->list, "button_press_event",
G_CALLBACK (ddb_listview_list_button_press_event),
NULL);
+ g_signal_connect ((gpointer) listview->list, "popup_menu",
+ G_CALLBACK (ddb_listview_list_popup_menu),
+ NULL);
g_signal_connect ((gpointer) listview->list, "scroll_event",
G_CALLBACK (ddb_listview_vscroll_event),
NULL);
@@ -2073,20 +2079,6 @@ ddb_listview_handle_keypress (DdbListview *ps, int keyval, int state) {
cursor = 0;
gtk_range_set_value (GTK_RANGE (range), gtk_adjustment_get_lower (adj));
}
- else if (keyval == GDK_Menu) {
- DdbListviewIter it = ps->binding->head ();
- while (it && !ps->binding->is_selected (it)) {
- DdbListviewIter next = ps->binding->next (it);
- ps->binding->unref (it);
- it = next;
- }
- if (it) {
- int sel = ps->binding->get_idx (it);
- ps->binding->list_context_menu (ps, it, sel);
- ps->binding->unref (it);
- }
- return TRUE;
- }
else {
return FALSE;
}
@@ -2154,6 +2146,23 @@ ddb_listview_handle_keypress (DdbListview *ps, int keyval, int state) {
return TRUE;
}
+gboolean
+ddb_listview_list_popup_menu (GtkWidget *widget, gpointer user_data) {
+ DdbListview *ps = DDB_LISTVIEW (g_object_get_data (G_OBJECT (widget), "owner"));
+ DdbListviewIter it = ps->binding->head ();
+ while (it && !ps->binding->is_selected (it)) {
+ DdbListviewIter next = ps->binding->next (it);
+ ps->binding->unref (it);
+ it = next;
+ }
+ if (it) {
+ int sel = ps->binding->get_idx (it);
+ ps->binding->list_context_menu (ps, it, sel);
+ ps->binding->unref (it);
+ }
+ return TRUE;
+}
+
int
ddb_listview_dragdrop_get_row_from_coord (DdbListview *listview, int y) {
if (y == -1) {
@@ -3335,7 +3344,9 @@ ddb_listview_clear_sort (DdbListview *listview) {
gboolean
ddb_listview_list_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data) {
DdbListview *listview = DDB_LISTVIEW (g_object_get_data (G_OBJECT (widget), "owner"));
- return ddb_listview_handle_keypress (listview, event->keyval, event->state);
-
+ if (!ddb_listview_handle_keypress (listview, event->keyval, event->state)) {
+ return on_mainwin_key_press_event (widget, event, user_data);
+ }
+ return TRUE;
}
diff --git a/plugins/gtkui/deadbeef.glade b/plugins/gtkui/deadbeef.glade
index c2082b28..967b97b3 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"/>
@@ -781,7 +781,7 @@
<signal name="delete_event" handler="gtk_widget_hide_on_delete" last_modification_time="Sat, 08 Aug 2009 23:03:33 GMT"/>
<signal name="configure_event" handler="on_searchwin_configure_event" last_modification_time="Mon, 28 Dec 2009 19:24:44 GMT"/>
<signal name="window_state_event" handler="on_searchwin_window_state_event" last_modification_time="Mon, 28 Dec 2009 19:26:50 GMT"/>
- <signal name="key_press_event" handler="on_searchwin_key_press_event" after="yes" last_modification_time="Mon, 21 Oct 2013 21:53:35 GMT"/>
+ <signal name="key_press_event" handler="on_searchwin_key_press_event" last_modification_time="Mon, 21 Oct 2013 21:53:35 GMT"/>
<child>
<widget class="GtkVBox" id="vbox4">
diff --git a/plugins/gtkui/interface.c b/plugins/gtkui/interface.c
index 49f4434d..d75ff742 100644
--- a/plugins/gtkui/interface.c
+++ b/plugins/gtkui/interface.c
@@ -461,9 +461,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);
@@ -739,9 +739,9 @@ create_searchwin (void)
g_signal_connect ((gpointer) searchwin, "window_state_event",
G_CALLBACK (on_searchwin_window_state_event),
NULL);
- g_signal_connect_after ((gpointer) searchwin, "key_press_event",
- G_CALLBACK (on_searchwin_key_press_event),
- NULL);
+ g_signal_connect ((gpointer) searchwin, "key_press_event",
+ G_CALLBACK (on_searchwin_key_press_event),
+ NULL);
g_signal_connect ((gpointer) searchentry, "changed",
G_CALLBACK (on_searchentry_changed),
NULL);
diff --git a/plugins/gtkui/search.c b/plugins/gtkui/search.c
index ed0d69e6..d6c9aed0 100644
--- a/plugins/gtkui/search.c
+++ b/plugins/gtkui/search.c
@@ -189,18 +189,14 @@ on_searchwin_key_press_event (GtkWidget *widget,
{
// that's for when user attempts to navigate list while entry has focus
if (event->keyval == GDK_Escape) {
- gtk_widget_hide (widget);
+ gtk_widget_hide (searchwin);
+ return TRUE;
}
else if (event->keyval == GDK_Return) {
on_searchentry_activate (NULL, 0);
+ return TRUE;
}
- else if (event->keyval != GDK_Delete && event->keyval != GDK_Home && event->keyval != GDK_End){
- GtkWidget *pl = lookup_widget (searchwin, "searchlist");
- if (!ddb_listview_handle_keypress (DDB_LISTVIEW (pl), event->keyval, event->state)) {
- return on_mainwin_key_press_event (widget, event, user_data);
- }
- }
- return TRUE;
+ return FALSE;
}
gboolean
@@ -411,6 +407,7 @@ DdbListviewBinding search_binding = {
void
search_playlist_init (GtkWidget *widget) {
DdbListview *listview = DDB_LISTVIEW(widget);
+ g_signal_connect ((gpointer)listview->list, "key_press_event", G_CALLBACK (on_searchwin_key_press_event), listview);
search_binding.ref = (void (*) (DdbListviewIter))deadbeef->pl_item_ref;
search_binding.unref = (void (*) (DdbListviewIter))deadbeef->pl_item_unref;
search_binding.is_selected = (int (*) (DdbListviewIter))deadbeef->pl_is_selected;