Commit d9bc9582 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Do not force URI loading for webviews with a related one

parent f5550dc5
Pipeline #76067 passed with stage
in 16 minutes and 52 seconds
......@@ -92,8 +92,8 @@ class WebView(WebKit2.WebView):
"""
try:
zoom_level = self._window.zoom_level
if self.__related_view is not None:
window = self.__related_view.get_ancestor(Gtk.Window)
if self._related_view is not None:
window = self._related_view.get_ancestor(Gtk.Window)
if window is not None and hasattr(window, "zoom_level"):
zoom_level = window.zoom_level
else:
......@@ -461,7 +461,7 @@ class WebView(WebKit2.WebView):
self._uri = None
self._initial_uri = None
self._title = None
self.__related_view = related_view
self._related_view = related_view
self._shown = False
self.set_hexpand(True)
self.set_vexpand(True)
......
......@@ -100,8 +100,11 @@ class WebViewSignals(WebViewMenuSignals, WebViewJsSignals,
if self._window != self.get_toplevel():
return
# URI set but not loaded
if webview.get_uri() is None and webview.uri is not None:
webview.load_uri(webview.uri)
# Webviews with a related webview have a None URI
if self.get_uri() is None and\
self.uri is not None and\
self._related_view is None:
self.load_uri(self.uri)
self._shown = True
self.emit("shown")
self.set_atime(int(time()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment