diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2012-11-21 16:23:27 (GMT) |
---|---|---|
committer | Manuel QuiƱones <manuq@laptop.org> | 2012-11-22 21:37:33 (GMT) |
commit | 843faffb867fb5212a2d0ce769083989d66d66b2 (patch) | |
tree | ba5f3bc640b4ad1bd4946b99689fbb56bf6c89bf | |
parent | 0f656938d30f6697095d940618f77173d8f9cb33 (diff) |
Avoid close the PDFTab when Esc is pressed SL #4246
Do not call "stop_loading" if the WebKit is not in 'loading' state
when 'Esc' is pressed.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r-- | webactivity.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/webactivity.py b/webactivity.py index 780b87f..0e3b61b 100644 --- a/webactivity.py +++ b/webactivity.py @@ -526,8 +526,12 @@ class WebActivity(activity.Activity): return True elif key_name == 'Escape': - _logger.debug('keyboard: Stop loading') - browser.stop_loading() + status = browser.get_load_status() + loading = WebKit.LoadStatus.PROVISIONAL <= status \ + < WebKit.LoadStatus.FINISHED + if loading: + _logger.debug('keyboard: Stop loading') + browser.stop_loading() return False |