[Xfce4-commits] <xfce4-appfinder:master> Always allow up/down unless the completion menu is shown.
Nick Schermer
noreply at xfce.org
Thu Sep 29 22:54:01 CEST 2011
Updating branch refs/heads/master
to fc3f26ba355cb95862054d85e161ce018bac7130 (commit)
from 7c214714e92593c132241ea32a82fd28fc7ee0f2 (commit)
commit fc3f26ba355cb95862054d85e161ce018bac7130
Author: Nick Schermer <nick at xfce.org>
Date: Thu Sep 29 22:53:28 2011 +0200
Always allow up/down unless the completion menu is shown.
src/appfinder-window.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/appfinder-window.c b/src/appfinder-window.c
index 8e5fdef..c34d4eb 100644
--- a/src/appfinder-window.c
+++ b/src/appfinder-window.c
@@ -553,20 +553,19 @@ xfce_appfinder_window_entry_key_press_event (GtkWidget *entry,
GdkEventKey *event,
XfceAppfinderWindow *window)
{
- gboolean expand;
- const gchar *text;
+ gboolean expand, is_expanded;
if (event->keyval == GDK_KEY_Up || event->keyval == GDK_KEY_Down)
{
- /* only switch modes when there is no text in the entry */
- text = gtk_entry_get_text (GTK_ENTRY (window->entry));
- if (IS_STRING (text)
- && !gtk_widget_get_visible (window->paned))
- return FALSE;
-
expand = (event->keyval == GDK_KEY_Down);
- if (gtk_widget_get_visible (window->paned) != expand)
+ is_expanded = gtk_widget_get_visible (window->paned);
+ if (is_expanded != expand)
{
+ /* don't break entry completion navigation in collapsed mode */
+ if (!is_expanded
+ && gdk_pointer_is_grabbed ())
+ return FALSE;
+
xfce_appfinder_window_set_expanded (window, expand);
return TRUE;
}
More information about the Xfce4-commits
mailing list