Fix keyboard focus issues.
This commit is contained in:
parent
d42e71a5d5
commit
e6f9c0ccea
3
BUGS
3
BUGS
@ -23,9 +23,6 @@ Bugs
|
||||
|
||||
- All kind of FIXMEs
|
||||
|
||||
- When opening DDG the input field should be focused when JS is active, but
|
||||
only is sometimes. (seir)
|
||||
|
||||
- restart sometimes abort()s on QApplication __init__ (V155)
|
||||
|
||||
- restart is broken entirely since init refactoring (around af19e6d~1)
|
||||
|
@ -290,6 +290,7 @@ class TabbedBrowser(TabWidget):
|
||||
if not background:
|
||||
self.setCurrentWidget(tab)
|
||||
tab.show()
|
||||
tab.setFocus()
|
||||
return tab
|
||||
|
||||
@pyqtSlot(str, int)
|
||||
@ -383,9 +384,9 @@ class TabbedBrowser(TabWidget):
|
||||
|
||||
@pyqtSlot(str)
|
||||
def on_mode_left(self, mode):
|
||||
"""Give focus to tabs if command mode was left."""
|
||||
"""Give focus to current tab if command mode was left."""
|
||||
if mode == "command":
|
||||
self.setFocus()
|
||||
self.currentWidget().setFocus()
|
||||
|
||||
@pyqtSlot(int)
|
||||
def on_current_changed(self, idx):
|
||||
|
@ -409,8 +409,10 @@ class WebView(QWebView):
|
||||
@pyqtSlot('QMouseEvent')
|
||||
def on_mouse_event(self, evt):
|
||||
"""Post a new mouseevent from a hintmanager."""
|
||||
focused = QApplication.focusWidget()
|
||||
self.setFocus()
|
||||
QApplication.postEvent(self, evt)
|
||||
focused.setFocus()
|
||||
|
||||
@pyqtSlot()
|
||||
def on_load_started(self):
|
||||
|
Loading…
Reference in New Issue
Block a user