aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--embed/ephy-embed.c13
-rw-r--r--embed/ephy-embed.h3
-rw-r--r--embed/mozilla/mozilla-embed.cpp17
4 files changed, 22 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index bd22f8925..e143e8014 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2005-07-29 Christian Persch <chpe@cvs.gnome.org>
+ * embed/ephy-embed.c:
+ * embed/ephy-embed.h:
+ * embed/mozilla/mozilla-embed.cpp:
+
+ Implement ::grab-focus and remove ephy_embed_activate ().
+
+2005-07-29 Christian Persch <chpe@cvs.gnome.org>
+
* src/ephy-shell.c: (ephy_shell_new_tab_full):
Realise the embed first before grabbing focus on it.
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index c6fa1431a..60e82be0a 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -732,19 +732,6 @@ ephy_embed_show_page_certificate (EphyEmbed *embed)
}
/**
- * ephy_embed_activate:
- * @embed: an #EphyEmbed
- *
- * Gives focus to @embed (i.e., Mozilla).
- **/
-void
-ephy_embed_activate (EphyEmbed *embed)
-{
- EphyEmbedIface *iface = EPHY_EMBED_GET_IFACE (embed);
- iface->activate (embed);
-}
-
-/**
* ephy_embed_set_encoding:
* @embed: an #EphyEmbed
* @encoding: the desired encoding
diff --git a/embed/ephy-embed.h b/embed/ephy-embed.h
index 7da209684..b83891242 100644
--- a/embed/ephy-embed.h
+++ b/embed/ephy-embed.h
@@ -195,7 +195,6 @@ struct _EphyEmbedIface
void (* print_preview_navigate) (EphyEmbed *embed,
EphyEmbedPrintPreviewNavType type,
int page);
- void (* activate) (EphyEmbed *embed);
gboolean (* has_modified_forms) (EphyEmbed *embed);
};
@@ -290,8 +289,6 @@ void ephy_embed_print_preview_navigate (EphyEmbed *embed,
int page);
/* Misc. utility */
-void ephy_embed_activate (EphyEmbed *embed);
-
gboolean ephy_embed_has_modified_forms (EphyEmbed *embed);
G_END_DECLS
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 4176821fc..1d96f65a4 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -184,9 +184,20 @@ mozilla_embed_get_type (void)
}
static void
-impl_activate (EphyEmbed *embed)
+mozilla_embed_grab_focus (GtkWidget *widget)
{
- gtk_widget_grab_focus (GTK_BIN (embed)->child);
+ GtkWidget *child;
+
+ child = gtk_bin_get_child (GTK_BIN (widget));
+
+ if (child != NULL)
+ {
+ gtk_widget_grab_focus (child);
+ }
+ else
+ {
+ g_warning ("Need to realize the embed before grabbing focus!\n");
+ }
}
#ifdef GTKMOZEMBED_BROKEN_FOCUS
@@ -290,6 +301,7 @@ mozilla_embed_class_init (MozillaEmbedClass *klass)
gtk_object_class->destroy = mozilla_embed_destroy;
+ widget_class->grab_focus = mozilla_embed_grab_focus;
widget_class->realize = mozilla_embed_realize;
#ifdef GTKMOZEMBED_BROKEN_FOCUS
@@ -1126,7 +1138,6 @@ ephy_embed_iface_init (EphyEmbedIface *iface)
iface->shistory_go_nth = impl_shistory_go_nth;
iface->get_security_level = impl_get_security_level;
iface->show_page_certificate = impl_show_page_certificate;
- iface->activate = impl_activate;
iface->set_encoding = impl_set_encoding;
iface->get_encoding = impl_get_encoding;
iface->has_automatic_encoding = impl_has_automatic_encoding;