Possibly fixed issue: #1484
This commit is contained in:
parent
0c1e82a103
commit
299c66b82c
@ -343,18 +343,14 @@ def _save_version():
|
|||||||
@pyqtSlot('QWidget*', 'QWidget*')
|
@pyqtSlot('QWidget*', 'QWidget*')
|
||||||
def on_focus_changed(_old, new):
|
def on_focus_changed(_old, new):
|
||||||
"""Register currently focused main window in the object registry."""
|
"""Register currently focused main window in the object registry."""
|
||||||
if new is None:
|
if new is None or not isinstance(new, mainwindow.MainWindow):
|
||||||
window = None
|
|
||||||
else:
|
|
||||||
window = new.window()
|
|
||||||
if window is None or not isinstance(window, mainwindow.MainWindow):
|
|
||||||
try:
|
try:
|
||||||
objreg.delete('last-focused-main-window')
|
objreg.delete('last-focused-main-window')
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
qApp.restoreOverrideCursor()
|
qApp.restoreOverrideCursor()
|
||||||
else:
|
else:
|
||||||
objreg.register('last-focused-main-window', window, update=True)
|
objreg.register('last-focused-main-window', new.window(), update=True)
|
||||||
_maybe_hide_mouse_cursor()
|
_maybe_hide_mouse_cursor()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user