aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog10
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.c24
2 files changed, 25 insertions, 9 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index fda34513c9..8743cd24a9 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,13 @@
+2003-04-16 Chris Toshok <toshok@ximian.com>
+
+ [ fixes #40694 ]
+ * gui/component/select-names/e-select-names-bonobo.c
+ (control_activate_cb): just grab focus if @activate == TRUE.
+ we'll do all merging/unmerging in the focus handler.
+ (widget_focus_cb): handle the merging here.
+ (e_bonobo_control_automerge_ui): store off the widget (so we can
+ grab focus on it) and connect to "activate".
+
2003-04-18 Rodney Dawes <dobey@ximian.com>
* gui/component/select-names/Makefile.am: Add missing -DPREFIX
diff --git a/addressbook/gui/component/select-names/e-select-names-bonobo.c b/addressbook/gui/component/select-names/e-select-names-bonobo.c
index b722baec6f..10fc9caee7 100644
--- a/addressbook/gui/component/select-names/e-select-names-bonobo.c
+++ b/addressbook/gui/component/select-names/e-select-names-bonobo.c
@@ -346,6 +346,7 @@ static BonoboUIVerb verbs [] = {
};
typedef struct {
+ GtkWidget *widget;
BonoboControl *control;
Bonobo_UIContainer remote_ui_container;
char *ui_xml_path;
@@ -404,21 +405,23 @@ control_activate_cb (BonoboControl *control,
gboolean activate,
ControlUIClosure *closure)
{
+ if (activate)
+ gtk_widget_grab_focus (closure->widget); /* the ECanvas */
+}
+
+static gboolean
+widget_focus_cb (GtkWidget *w, GdkEventFocus *focus, ControlUIClosure *closure)
+{
BonoboUIComponent *uic;
- uic = bonobo_control_get_ui_component (control);
+ uic = bonobo_control_get_ui_component (closure->control);
- if (activate) {
- merge_menu_items (control, uic, closure);
+ if (GTK_WIDGET_HAS_FOCUS (w)) {
+ merge_menu_items (closure->control, uic, closure);
} else {
- unmerge_menu_items (control, uic, closure);
+ unmerge_menu_items (closure->control, uic, closure);
}
-}
-static gboolean
-widget_focus_cb (GtkWidget *w, GdkEventFocus *focus, ControlUIClosure *closure)
-{
- control_activate_cb (closure->control, GTK_WIDGET_HAS_FOCUS (w), closure);
return FALSE;
}
@@ -440,6 +443,7 @@ e_bonobo_control_automerge_ui (GtkWidget *w,
closure = g_new (ControlUIClosure, 1);
+ closure->widget = w;
closure->control = control;
closure->ui_xml_path = g_strdup (ui_xml_path);
closure->app_name = g_strdup (app_name);
@@ -450,6 +454,8 @@ e_bonobo_control_automerge_ui (GtkWidget *w,
G_CALLBACK (widget_focus_cb), closure);
g_signal_connect (w, "focus_out_event",
G_CALLBACK (widget_focus_cb), closure);
+ g_signal_connect (control, "activate",
+ G_CALLBACK (control_activate_cb), closure);
g_signal_connect (control, "set_frame",
G_CALLBACK (control_set_frame_cb), closure);