diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-07-29 01:52:51 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-07-29 01:52:51 +0800 |
commit | 90586b820dea7fdb2588b24939ae72514f87c73d (patch) | |
tree | 8388e597298991275745bcb53908ad39b740dfbf /embed/mozilla/EphyBrowser.cpp | |
parent | a6467707fdbf7e67dbea0ba685dd0ba5c0ffbfdb (diff) | |
download | gsoc2013-epiphany-90586b820dea7fdb2588b24939ae72514f87c73d.tar gsoc2013-epiphany-90586b820dea7fdb2588b24939ae72514f87c73d.tar.gz gsoc2013-epiphany-90586b820dea7fdb2588b24939ae72514f87c73d.tar.bz2 gsoc2013-epiphany-90586b820dea7fdb2588b24939ae72514f87c73d.tar.lz gsoc2013-epiphany-90586b820dea7fdb2588b24939ae72514f87c73d.tar.xz gsoc2013-epiphany-90586b820dea7fdb2588b24939ae72514f87c73d.tar.zst gsoc2013-epiphany-90586b820dea7fdb2588b24939ae72514f87c73d.zip |
Work around gtkmozembed focus bug. Fixes bug #105153.
2005-07-28 Christian Persch <chpe@cvs.gnome.org>
* configure.ac:
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EphyBrowser.h:
* embed/mozilla/mozilla-embed.cpp:
* src/ephy-shell.c: (url_is_empty), (load_homepage),
(ephy_shell_new_tab_full):
Work around gtkmozembed focus bug. Fixes bug #105153.
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index ba295ef7c..231b5c4ac 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -536,6 +536,9 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed) getter_AddRefs(mWebBrowser)); NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE); + mWebBrowserFocus = do_QueryInterface (mWebBrowser); + NS_ENSURE_TRUE (mWebBrowserFocus, NS_ERROR_FAILURE); + mWebBrowser->GetContentDOMWindow (getter_AddRefs (mDOMWindow)); NS_ENSURE_TRUE (mDOMWindow, NS_ERROR_FAILURE); @@ -861,13 +864,9 @@ nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) } /* Use the focused document */ - nsCOMPtr<nsIWebBrowserFocus> webBrowserFocus; - webBrowserFocus = do_QueryInterface (mWebBrowser); - NS_ENSURE_TRUE (webBrowserFocus, NS_ERROR_FAILURE); - nsresult rv; nsCOMPtr<nsIDOMWindow> DOMWindow; - rv = webBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); + rv = mWebBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); if (NS_SUCCEEDED (rv) && DOMWindow) { return DOMWindow->GetDocument (aDOMDocument); @@ -1324,3 +1323,21 @@ EphyBrowser::GetDocumentType () return type; } + +#ifdef GTKMOZEMBED_BROKEN_FOCUS +nsresult +EphyBrowser::FocusActivate () +{ + NS_ENSURE_STATE (mWebBrowserFocus); + + return mWebBrowserFocus->Activate(); +} + +nsresult +EphyBrowser::FocusDeactivate () +{ + NS_ENSURE_STATE (mWebBrowserFocus); + + return mWebBrowserFocus->Deactivate(); +} +#endif /* GTKMOZEMBED_BROKEN_FOCUS */ |