mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-22 07:37:40 +00:00
feat(linux): Try only 5 instead of 10000 times to connect to ibus
Part of #4910.
This commit is contained in:
parent
529ab546cb
commit
5a3a7910ab
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import time
|
||||
import gi
|
||||
import logging
|
||||
import subprocess
|
||||
|
|
@ -10,11 +11,12 @@ from gi.repository import IBus, Gio
|
|||
|
||||
def get_ibus_bus():
|
||||
try:
|
||||
for i in range(10000):
|
||||
for i in range(5):
|
||||
bus = IBus.Bus()
|
||||
if bus.is_connected() and bus.is_global_engine_enabled():
|
||||
return bus
|
||||
bus.destroy()
|
||||
time.sleep(1)
|
||||
except Exception as e:
|
||||
logging.warning("Failed get bus")
|
||||
logging.warning(e)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue