This commit is contained in:
恍兮惚兮 2024-05-29 12:42:12 +08:00
parent 07d1172614
commit ef52227523
2 changed files with 10 additions and 9 deletions

View File

@ -122,13 +122,10 @@ class edittrans(QMainWindow):
self.trykeeppos()
def trykeeppos(self):
try:
self.followhwnd = gobject.baseobject.textsource.hwnd
self.follow()
self.show()
except:
pass
self.followhwnd = gobject.baseobject.textsource.hwnd
self.follow()
self.show()
@threader
def follow(self):
while True:

View File

@ -43,8 +43,12 @@ def Singleton_impl(cls, behavior="activate"):
self.deleteLater()
_instance.pop(cls)
_lock.release()
_inst = __(*args, **kwagrs)
try:
_inst = __(*args, **kwagrs)
except:
print_exc()
_lock.release()
return None
if _inst.Singleton_flag:
_instance[cls] = _inst
return _inst