Esc or Alt-F4 key not deactivating Dash on initial attempt

Bug #1479892 reported by Aritchie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unity-2d
Invalid
Medium
Unassigned

Bug Description

Ubuntu 12.04.5
Unity-2d 5.14

After logging into the Desktop, the Escape key or Alt-f4 key do not work on initial activation of Dash or Runner. You have to click on the Desktop to dismiss them. After this, the keys work fine when bringing up the Dash or Runner. Now if after logging in I first click on the Desktop or activate an app and then bring up the Dash or Runner, the keys work fine.

Revision history for this message
Aritchie (aritchie) wrote :

Is this an issue with the QML code or C++ code? I wouldn't mind taking a look at it and see if I can do something.

Revision history for this message
Gerry Boland (gerboland) wrote :

Hey Aritchie,
other keys are working ok I suppose??

I suppose the mission is to figure out where those keypresses are going. If you see shell/Shell.qml, there's this code:

    Keys.onPressed: {
        if (event.key == Qt.Key_Escape || (event.key == Qt.Key_F4 && event.modifiers == Qt.AltModifier )) {
            declarativeView.forceDeactivateWindow()
        }
    }

which does the dismiss action. I believe this Keys.onPressed will only work if its parent Item has focus. In QML, the "focus" property indicates it *can* have input focus, and "activeFocus" indicates it *does* have input focus. When I say "input focus" I mean if you press a key, it will get it.

My QML1 is rusty now, but maybe try adding a
onActiveFocusChanged: console.log("Shell.qml: activeFocus changed", activeFocus)
and see at what time it prints.

It may be on first activation, the active focus is not correctly set. Or on first activation, the window containing the Dash/Runner does not think it has input focus (but it does since you can type into it).

Focus topics are tricky as hell, good luck!

Note unfortunately unity-2d is in maintenance mode, so we can't devote resources to fixing non-critical issues. Apologies
-G

Changed in unity-2d:
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → Medium
Revision history for this message
Aritchie (aritchie) wrote :

Hi Gerry, yes the Tab key and arrow keys all work fine on first attempt so navigating with the keyboard with in the Dash and Runner work fine from the get go. It is just the Esc key and Alt-F4 that do not work on first run. I did see those lines in the Shell.qml file and will try your suggestions and see what I come up with. Thank you so much.

Revision history for this message
Aritchie (aritchie) wrote :

This is the output produced in the XSeesion log after I inserted the code.

unity-2d-shell: [WARNING] void ShellManager::forceDeactivateShell(ShellDeclarativeView*): No previously focused window found, use mouse to select window.

So yeah it looks like your first suggestion is correct. It's parent window is not getting the focus on initial start up. I will see if I can find out what the parent window is and see what I can do to fix it. Thanks again.

Changed in unity-2d:
status: Triaged → Invalid
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.