mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
workaround _programLayout missing bug
This commit is contained in:
parent
0110875a9d
commit
054287445c
1 changed files with 3 additions and 1 deletions
|
@ -980,6 +980,7 @@ class FactEdit(QTextEdit):
|
||||||
def __init__(self, parent, *args):
|
def __init__(self, parent, *args):
|
||||||
QTextEdit.__init__(self, *args)
|
QTextEdit.__init__(self, *args)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
self._programLayout = None
|
||||||
if sys.platform.startswith("win32"):
|
if sys.platform.startswith("win32"):
|
||||||
self._ownLayout = None
|
self._ownLayout = None
|
||||||
|
|
||||||
|
@ -1084,7 +1085,8 @@ class FactEdit(QTextEdit):
|
||||||
self.parent.lastFocusedEdit = self
|
self.parent.lastFocusedEdit = self
|
||||||
self.parent.resetFormatButtons()
|
self.parent.resetFormatButtons()
|
||||||
self.parent.disableButtons()
|
self.parent.disableButtons()
|
||||||
if sys.platform.startswith("win32"):
|
# for some reason this can be fired before a focus in has fired
|
||||||
|
if sys.platform.startswith("win32") and self._programLayout:
|
||||||
self._ownLayout = GetKeyboardLayout(0)
|
self._ownLayout = GetKeyboardLayout(0)
|
||||||
ActivateKeyboardLayout(self._programLayout, 0)
|
ActivateKeyboardLayout(self._programLayout, 0)
|
||||||
self.emit(SIGNAL("lostFocus"))
|
self.emit(SIGNAL("lostFocus"))
|
||||||
|
|
Loading…
Reference in a new issue