Restore focus to webview after clicking tab-bg

This commit is contained in:
Jay Kamat 2018-05-09 11:02:42 -07:00
parent 48c44e1b4d
commit 262cea8e75
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -210,10 +210,10 @@ class HintActions:
else:
target_mapping[Target.tab] = usertypes.ClickTarget.tab
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=self._win_id)
if context.target in [Target.normal, Target.current]:
# Set the pre-jump mark ', so we can jump back here after following
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=self._win_id)
tabbed_browser.set_mark("'")
try:
@ -227,6 +227,10 @@ class HintActions:
except webelem.Error as e:
raise HintingError(str(e))
if context.target == Target.tab_bg:
# We lost focus when clicking in the background, get it back.
tabbed_browser.widget.currentWidget().setFocus()
def yank(self, url, context):
"""Yank an element to the clipboard or primary selection.