[gnome-control-center/gnome-3-8] 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/gnome-3-8] region: Stop focusing the input chooser entry if already focused
- Date: Mon, 13 May 2013 15:01:47 +0000 (UTC)
commit 139b810e2f353e3b9606ef2a6f5a5a79f42b3afa
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 1d1c980..bc25381 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]