Commit 2b8b534f authored by Cédric Bellegarde's avatar Cédric Bellegarde

Do not override snapshot on stop_loading()

parent 43cce9d5
Pipeline #164131 failed with stage
in 6 minutes and 5 seconds
......@@ -287,6 +287,13 @@ class WebView(WebKit2.WebView):
"""
self.__window = window
def stop_loading(self):
"""
Stop loading webview
"""
self._loading = False
WebKit2.WebView.stop_loading(self)
@property
def readability(self):
"""
......@@ -380,6 +387,7 @@ class WebView(WebKit2.WebView):
WebViewCredentials.__init__(self)
self.__window = window
self.__atime = 0
self._loading = False
self.__children = []
self.__parent = None
self._readability = False
......
......@@ -65,6 +65,7 @@ class WebViewArtwork:
@param event as WebKit2.LoadEvent
"""
if event == WebKit2.LoadEvent.STARTED:
self._loading = True
self.__is_snapshot_valid = False
self.__cancellable.cancel()
self.__cancellable = Gio.Cancellable()
......@@ -74,8 +75,11 @@ class WebViewArtwork:
elif event == WebKit2.LoadEvent.FINISHED:
if self.__snapshot_id is not None:
GLib.source_remove(self.__snapshot_id)
self.__snapshot_id = GLib.timeout_add(2500,
self.__set_snapshot)
self.__snapshot_id = None
if self._loading:
self.__snapshot_id = GLib.timeout_add(2500,
self.__set_snapshot)
self._loading = False
#######################
# PRIVATE #
......
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