Discovered that loss of focus is caused by GrabAccelerator dbus method, handled by compiz. Gnome/unity-settings-daemon does not make focus go away by itself. You can try following script:
#!/usr/bin/python
import dbus
bus = dbus.SessionBus()
o = bus.get_object('org.gnome.Shell', '/org/gnome/Shell')
code = o.GrabAccelerator('1', 0, dbus_interface='org.gnome.Shell')
try:
raw_input("Grab set to key '1', press Enter to continue and ungrab")
finally:
print o.UngrabAccelerator(code, dbus_interface='org.gnome.Shell')
It sets grab to '1' key, then pressing '1' causes the same effects of losing focus (blink of cursor in terminal; cancel of rename in Nautilus, etc).
I didn't remove unity-settings-daemon from this bug because maybe it uses this dbus method for wrong purpose (maybe it's not suited for binding keys for switching keyboard).
Discovered that loss of focus is caused by GrabAccelerator dbus method, handled by compiz. Gnome/unity- settings- daemon does not make focus go away by itself. You can try following script:
#!/usr/bin/python object( 'org.gnome. Shell', '/org/gnome/Shell') or('1', 0, dbus_interface= 'org.gnome. Shell') ator(code, dbus_interface= 'org.gnome. Shell')
import dbus
bus = dbus.SessionBus()
o = bus.get_
code = o.GrabAccelerat
try:
raw_input("Grab set to key '1', press Enter to continue and ungrab")
finally:
print o.UngrabAcceler
It sets grab to '1' key, then pressing '1' causes the same effects of losing focus (blink of cursor in terminal; cancel of rename in Nautilus, etc).
I didn't remove unity-settings- daemon from this bug because maybe it uses this dbus method for wrong purpose (maybe it's not suited for binding keys for switching keyboard).