Trying to grab a hotkey that is already grabbed fails silently

Bug #735500 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-2d
Fix Released
Medium
Ugo Riboni

Bug Description

While implementing keyboard navigation in the launcher, I was trying to register a Hotkey watch for Alt+F1 to give the keyboard focus to the launcher. But the slot I connected to the pressed() signal would never be triggered.

We later discovered that this was because the Alt+F1 combination was already grabbed by metacity. Trying to grab a key combination that is already grabbed normally results in a BadAccess X error, but this error was swallowed by the error handler set up in Unity2dPlugin::initializeEngine(…). Note that there is already a FIXME in the code to improve this error handler:

/* FIXME: This should be done more properly, it's just an hack this way.
          We should silence only the errors that we know we can produce.
          We could probably also learn something from gdk-error-trap-push.
          See: http://library.gnome.org/devel/gdk/stable/gdk-General.html#gdk-error-trap-push
 */

Related branches

Olivier Tilloy (osomon)
Changed in unity-2d:
assignee: nobody → Ugo Riboni (uriboni)
Changed in unity-2d:
importance: Undecided → Wishlist
status: New → Confirmed
importance: Wishlist → Medium
Revision history for this message
Olivier Tilloy (osomon) wrote :

This was fixed at revision 462. Trying to grab a key that is already grabbed now issues a warning.

Changed in unity-2d:
milestone: none → 3.8
status: Confirmed → Fix Committed
Changed in unity-2d:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.