Comment 14 for bug 1244090

Revision history for this message
kolen (incredible-angst) wrote :

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).