mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-24 00:27:40 +00:00
fix(linux): Don't start ibus-daemon multiple times
This change adds a 1s sleep after restarting ibus before checking that it actually runs. Hopefully this will solve the problem. Since this bug is hard to reproduce, we also log a critical error for the other code path this could happen. Fixes #6237.
This commit is contained in:
parent
9b46242d32
commit
e30c00733a
1 changed files with 4 additions and 1 deletions
|
|
@ -91,7 +91,9 @@ def _verify_ibus_daemon():
|
|||
ps = subprocess.run(('ps', '--user', user, '-o', 's=', '-o', 'cmd'), stdout=subprocess.PIPE).stdout
|
||||
if not re.search('^[^ZT] ibus-daemon .*--xim.*', ps.decode('utf-8'), re.MULTILINE):
|
||||
_start_ibus_daemon(realuser)
|
||||
except subprocess.CalledProcessError:
|
||||
except subprocess.CalledProcessError as e:
|
||||
# Log criticial error in order to track down #6237
|
||||
logging.critical('getting ibus-daemon failed (%s: %s)', type(e), e.args)
|
||||
_start_ibus_daemon(realuser)
|
||||
|
||||
|
||||
|
|
@ -130,6 +132,7 @@ def restart_ibus(bus=None):
|
|||
except Exception as e:
|
||||
logging.warning("Failed to restart IBus")
|
||||
logging.warning(e)
|
||||
time.sleep(1) # 1s
|
||||
_verify_ibus_daemon()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue