From 843faffb867fb5212a2d0ce769083989d66d66b2 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Wed, 21 Nov 2012 16:23:27 +0000 Subject: 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 Acked-by: Manuel QuiƱones --- 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 -- cgit v0.9.1