aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-04-20 06:16:41 +0800
committerChris Toshok <toshok@src.gnome.org>2003-04-20 06:16:41 +0800
commita17a25e3496d7ce1bbd57a763076c446b78bdb70 (patch)
treeb5799d8457520882f61f3ebded5a1731efe4b4d9 /addressbook/gui
parent5cf9db22084a646cec7d655926db67b8650f65a4 (diff)
downloadgsoc2013-evolution-a17a25e3496d7ce1bbd57a763076c446b78bdb70.tar
gsoc2013-evolution-a17a25e3496d7ce1bbd57a763076c446b78bdb70.tar.gz
gsoc2013-evolution-a17a25e3496d7ce1bbd57a763076c446b78bdb70.tar.bz2
gsoc2013-evolution-a17a25e3496d7ce1bbd57a763076c446b78bdb70.tar.lz
gsoc2013-evolution-a17a25e3496d7ce1bbd57a763076c446b78bdb70.tar.xz
gsoc2013-evolution-a17a25e3496d7ce1bbd57a763076c446b78bdb70.tar.zst
gsoc2013-evolution-a17a25e3496d7ce1bbd57a763076c446b78bdb70.zip
[ fixes #40694 ] just grab focus if @activate == TRUE. we'll do all
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". svn path=/trunk/; revision=20897
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-bonobo.c24
1 files changed, 15 insertions, 9 deletions
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);