diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2012-11-19 14:51:12 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2012-11-19 20:45:36 (GMT) |
commit | 9ac0a9e44f2b866cc4ec9a2fbac7c09c77ecb2f4 (patch) | |
tree | ce847ebab3099461f2ce6bf26debae15df6c37c2 | |
parent | bcec5caa2fa3bc430fc46568606a2692214c6628 (diff) |
Hanlde focus properly on each tab SL #4200
The focus is grabbed after loading the 'Home page' and when the
session is restored.
This patch allow us to show the OSK when it's needed and to be able to
start typing with the hardware keyboard.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r-- | browser.py | 1 | ||||
-rw-r--r-- | webactivity.py | 2 |
2 files changed, 3 insertions, 0 deletions
@@ -303,6 +303,7 @@ class TabbedView(BrowserNotebook): default_page = os.path.join(activity.get_bundle_path(), "data/index.html") browser.load_uri('file://' + default_page) + browser.grab_focus() def _get_current_browser(self): if self.get_n_pages(): diff --git a/webactivity.py b/webactivity.py index 6dbd222..780b87f 100644 --- a/webactivity.py +++ b/webactivity.py @@ -409,6 +409,7 @@ class WebActivity(activity.Activity): for number, tab in enumerate(self.model.data['currents']): tab_page = self._tabbed_view.get_nth_page(number) tab_page.browser.set_history_index(tab['history_index']) + tab_page.browser.grab_focus() self._tabbed_view.set_current_page(self.model.data['current_tab']) elif self.metadata['mime_type'] == 'text/uri-list': @@ -422,6 +423,7 @@ class WebActivity(activity.Activity): else: file_uri = 'file://' + file_path self._tabbed_view.props.current_browser.load_uri(file_uri) + self._tabbed_view.props.current_browser.grab_focus() def write_file(self, file_path): if not self.metadata['mime_type']: |