aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-05-09 19:45:35 +0800
committerMilan Crha <mcrha@redhat.com>2014-05-09 19:45:35 +0800
commitc1597795c147c5ed601d5284cd9c9bd792c67516 (patch)
tree7b495c6415a995d020b28cddad25397229c8d0ae /addressbook/gui
parentc7ddf191bf61930852a546be9865235528c9f2c6 (diff)
downloadgsoc2013-evolution-c1597795c147c5ed601d5284cd9c9bd792c67516.tar
gsoc2013-evolution-c1597795c147c5ed601d5284cd9c9bd792c67516.tar.gz
gsoc2013-evolution-c1597795c147c5ed601d5284cd9c9bd792c67516.tar.bz2
gsoc2013-evolution-c1597795c147c5ed601d5284cd9c9bd792c67516.tar.lz
gsoc2013-evolution-c1597795c147c5ed601d5284cd9c9bd792c67516.tar.xz
gsoc2013-evolution-c1597795c147c5ed601d5284cd9c9bd792c67516.tar.zst
gsoc2013-evolution-c1597795c147c5ed601d5284cd9c9bd792c67516.zip
EContactEditor: Restore focused widget in sensitize_all()
Recent changes in commit c2de4087369147e introduced a regression in preselected widget after editor open, it was 'e-mail', instead of 'fullname' after that commit. The focus changes when the dyntable was updating maximum allowed entries in itself.
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 081c9fb8b0..fada757b95 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -3104,6 +3104,18 @@ extract_all (EContactEditor *editor)
static void
sensitize_all (EContactEditor *editor)
{
+ GtkWidget *focused_widget;
+ gpointer weak_pointer;
+
+ /* Widget changes can cause focus widget change, thus remember the current
+ widget and restore it after the fill is done; some fill operations
+ can delete widgets, like the dyntable, thus do the weak_pointer as well.
+ */
+ focused_widget = gtk_window_get_focus (eab_editor_get_window (EAB_EDITOR (editor)));
+ weak_pointer = focused_widget;
+ if (focused_widget)
+ g_object_add_weak_pointer (G_OBJECT (focused_widget), &weak_pointer);
+
sensitize_ok (editor);
sensitize_simple (editor);
sensitize_email (editor);
@@ -3111,6 +3123,11 @@ sensitize_all (EContactEditor *editor)
sensitize_sip (editor);
sensitize_im (editor);
sensitize_address (editor);
+
+ if (weak_pointer) {
+ g_object_remove_weak_pointer (G_OBJECT (focused_widget), &weak_pointer);
+ gtk_widget_grab_focus (focused_widget);
+ }
}
static void