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): ...@@ -92,8 +92,8 @@ class WebView(WebKit2.WebView):
""" """
try: try:
zoom_level = self._window.zoom_level zoom_level = self._window.zoom_level
if self.__related_view is not None: if self._related_view is not None:
window = self.__related_view.get_ancestor(Gtk.Window) window = self._related_view.get_ancestor(Gtk.Window)
if window is not None and hasattr(window, "zoom_level"): if window is not None and hasattr(window, "zoom_level"):
zoom_level = window.zoom_level zoom_level = window.zoom_level
else: else:
...@@ -461,7 +461,7 @@ class WebView(WebKit2.WebView): ...@@ -461,7 +461,7 @@ class WebView(WebKit2.WebView):
self._uri = None self._uri = None
self._initial_uri = None self._initial_uri = None
self._title = None self._title = None
self.__related_view = related_view self._related_view = related_view
self._shown = False self._shown = False
self.set_hexpand(True) self.set_hexpand(True)
self.set_vexpand(True) self.set_vexpand(True)
......
...@@ -100,8 +100,11 @@ class WebViewSignals(WebViewMenuSignals, WebViewJsSignals, ...@@ -100,8 +100,11 @@ class WebViewSignals(WebViewMenuSignals, WebViewJsSignals,
if self._window != self.get_toplevel(): if self._window != self.get_toplevel():
return return
# URI set but not loaded # URI set but not loaded
if webview.get_uri() is None and webview.uri is not None: # Webviews with a related webview have a None URI
webview.load_uri(webview.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._shown = True
self.emit("shown") self.emit("shown")
self.set_atime(int(time())) 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