aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-07-30 04:12:55 +0800
committerChristian Persch <chpe@src.gnome.org>2005-07-30 04:12:55 +0800
commitdb1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0 (patch)
tree02234f3fb181aca685fcc29da0ff92687c7a1cfa /embed
parent941de06806cb6c145ac2b522ad276add5bdbb2fd (diff)
downloadgsoc2013-epiphany-db1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0.tar
gsoc2013-epiphany-db1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0.tar.gz
gsoc2013-epiphany-db1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0.tar.bz2
gsoc2013-epiphany-db1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0.tar.lz
gsoc2013-epiphany-db1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0.tar.xz
gsoc2013-epiphany-db1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0.tar.zst
gsoc2013-epiphany-db1f5a7b30564f89cf1fdbb3cd6a8fae68a9bfd0.zip
Implement ::grab-focus and remove ephy_embed_activate ().
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 ().
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c13
-rw-r--r--embed/ephy-embed.h3
-rw-r--r--embed/mozilla/mozilla-embed.cpp17
3 files changed, 14 insertions, 19 deletions
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;