[Xfce4-commits] <xfce4-settings:master> Use Escape on empty filter to close window.
Nick Schermer
noreply at xfce.org
Fri Jan 27 21:20:01 CET 2012
Updating branch refs/heads/master
to 7b97ce5c7043243c341df39fc7a81b722123fa79 (commit)
from c25354e775341696cee3c7e8385792ff1789875f (commit)
commit 7b97ce5c7043243c341df39fc7a81b722123fa79
Author: Nick Schermer <nick at xfce.org>
Date: Fri Jan 27 21:19:20 2012 +0100
Use Escape on empty filter to close window.
.../xfce-settings-manager-dialog.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/xfce4-settings-manager/xfce-settings-manager-dialog.c b/xfce4-settings-manager/xfce-settings-manager-dialog.c
index 17c91ce..4361993 100644
--- a/xfce4-settings-manager/xfce-settings-manager-dialog.c
+++ b/xfce4-settings-manager/xfce-settings-manager-dialog.c
@@ -676,12 +676,16 @@ xfce_settings_manager_dialog_entry_key_press (GtkWidget *entry,
GtkTreePath *path;
gint n_visible_items;
GtkTreeModel *model;
+ const gchar *text;
if (event->keyval == GDK_Escape)
{
- gtk_entry_set_text (GTK_ENTRY (entry), "");
-
- return TRUE;
+ text = gtk_entry_get_text (GTK_ENTRY (entry));
+ if (text != NULL && *text != '\0')
+ {
+ gtk_entry_set_text (GTK_ENTRY (entry), "");
+ return TRUE;
+ }
}
else if (event->keyval == GDK_Return)
{
More information about the Xfce4-commits
mailing list