[gnome-control-center] region: Stop focusing the input chooser entry if already focused
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Stop focusing the input chooser entry if already focused
- Date: Mon, 13 May 2013 15:03:21 +0000 (UTC)
commit 561c68674b07ffc0c0d2a4c0586464a8a8623e82
Author: Rui Matos <tiagomatos gmail com>
Date: Fri Mar 8 21:19:30 2013 +0100
region: Stop focusing the input chooser entry if already focused
Since doing so selects the entry's text and thus is prone to cause
accidental deletion.
https://bugzilla.gnome.org/show_bug.cgi?id=695466
panels/region/cc-input-chooser.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/panels/region/cc-input-chooser.c b/panels/region/cc-input-chooser.c
index ce7d446..1a3728d 100644
--- a/panels/region/cc-input-chooser.c
+++ b/panels/region/cc-input-chooser.c
@@ -375,7 +375,8 @@ show_input_sources_for_locale (GtkWidget *chooser,
egg_list_box_refilter (EGG_LIST_BOX (priv->list));
egg_list_box_set_selection_mode (EGG_LIST_BOX (priv->list), GTK_SELECTION_SINGLE);
- if (gtk_widget_is_visible (priv->filter_entry))
+ if (gtk_widget_is_visible (priv->filter_entry) &&
+ !gtk_widget_is_focus (priv->filter_entry))
gtk_widget_grab_focus (priv->filter_entry);
}
@@ -429,7 +430,8 @@ show_locale_widgets (GtkWidget *chooser)
egg_list_box_refilter (EGG_LIST_BOX (priv->list));
egg_list_box_set_selection_mode (EGG_LIST_BOX (priv->list), GTK_SELECTION_NONE);
- if (gtk_widget_is_visible (priv->filter_entry))
+ if (gtk_widget_is_visible (priv->filter_entry) &&
+ !gtk_widget_is_focus (priv->filter_entry))
gtk_widget_grab_focus (priv->filter_entry);
if (!priv->showing_extra)
@@ -619,7 +621,8 @@ show_filter_widgets (GtkWidget *chooser)
egg_list_box_refilter (EGG_LIST_BOX (priv->list));
egg_list_box_set_selection_mode (EGG_LIST_BOX (priv->list), GTK_SELECTION_SINGLE);
- if (gtk_widget_is_visible (priv->filter_entry))
+ if (gtk_widget_is_visible (priv->filter_entry) &&
+ !gtk_widget_is_focus (priv->filter_entry))
gtk_widget_grab_focus (priv->filter_entry);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]