Clean up caret initialisation.
This commit is contained in:
parent
a728704cce
commit
222627b08d
@ -441,12 +441,11 @@ class WebView(QWebView):
|
|||||||
settings.setAttribute(QWebSettings.CaretBrowsingEnabled, True)
|
settings.setAttribute(QWebSettings.CaretBrowsingEnabled, True)
|
||||||
self.selection_enabled = False
|
self.selection_enabled = False
|
||||||
|
|
||||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
if self.isVisible():
|
||||||
window=self.win_id)
|
# Sometimes the caret isn't immediately visible, but unfocusing
|
||||||
if tabbed_browser.currentWidget().tab_id == self.tab_id:
|
# and refocusing it fixes that.
|
||||||
self.clearFocus()
|
self.clearFocus()
|
||||||
self.setFocus(Qt.OtherFocusReason)
|
self.setFocus(Qt.OtherFocusReason)
|
||||||
|
|
||||||
self.page().currentFrame().evaluateJavaScript(
|
self.page().currentFrame().evaluateJavaScript(
|
||||||
utils.read_file('javascript/position_caret.js'))
|
utils.read_file('javascript/position_caret.js'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user