Child windows don't get focused

Bug #1671072 reported by Lukáš Tinkl
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
High
Michał Sawicz
Mir
Invalid
Undecided
Unassigned
MirAL
Fix Released
High
Alan Griffiths
mir (Ubuntu)
Invalid
Undecided
Unassigned
miral (Ubuntu)
Fix Released
Undecided
Unassigned
qtmir (Ubuntu)
Fix Released
Undecided
Daniel d'Andrada
unity8 (Ubuntu)
Fix Released
High
Daniel d'Andrada

Bug Description

1. Start Kate
2. Press Ctrl+O to open the file dialog
3. Notice the file dialog "appears" to be focused, the cursor in the filename text field is blinking but you can't start typing the filename and you can't e.g. dismiss the dialog by pressing Esc
4. Only after you've clicked the filename textfield, you can start typing and hit Esc to close
5. After closing the dialog, you are left with no focused window at all

Related branches

Michał Sawicz (saviq)
Changed in unity8 (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in canonical-devices-system-image:
status: New → Triaged
importance: Undecided → High
milestone: none → u8c-1
assignee: nobody → Michał Sawicz (saviq)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtmir (Ubuntu):
status: New → Confirmed
Changed in qtmir (Ubuntu):
assignee: nobody → Daniel d'Andrada (dandrader)
Changed in unity8 (Ubuntu):
assignee: nobody → Daniel d'Andrada (dandrader)
Changed in qtmir (Ubuntu):
status: Confirmed → In Progress
Changed in unity8 (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Child window not getting qml active focus when it gets MirSurface focus is one bug.

The top-level window is not getting qml active focus when its child is closed because its MirSurface is also not getting focus. That's a different bug and it's at qtmir/miral level (most likely miral).

Changed in qtmir (Ubuntu):
status: In Progress → Invalid
Changed in miral:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Alan Griffiths (alan-griffiths)
milestone: none → 1.3.1
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Confirmed that miral-shell (both decorated and tiling) fail to set the focus anywhere sane.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

miral-shell gets to step 5 before there's a focus issue. Here's the problem:

[2017-03-16 14:14:51.298369] miral::Window Management: info_for -> Open File
[2017-03-16 14:14:52.798261] miral::Window Management: handle_modify_window window_info={name=Open File, type=dialog, state=restored, parent=Untitled , children={}, min_width=325, min_height=178, max_width=16777215, max_height=16777215, preferred_orientation=0xf, confine_pointer=0, output_id=0}, modifications={state=hidden}
[2017-03-16 14:14:52.798423] miral::Window Management: modify_window window_info={name=Open File, type=dialog, state=restored, parent=Untitled , children={}, min_width=325, min_height=178, max_width=16777215, max_height=16777215, preferred_orientation=0xf, confine_pointer=0, output_id=0}, modifications={state=hidden}
[2017-03-16 14:14:52.798490] miral::Window Management: advise_state_change window_info={name=Open File, type=dialog, state=restored, parent=Untitled , children={}, min_width=325, min_height=178, max_width=16777215, max_height=16777215, preferred_orientation=0xf, confine_pointer=0, output_id=0}, state=hidden
[2017-03-16 14:14:52.798560] miral::Window Management: advise_focus_gained window_info={name=Open File, type=dialog, state=restored, parent=Untitled , children={}, min_width=325, min_height=178, max_width=16777215, max_height=16777215, preferred_orientation=0xf, confine_pointer=0, output_id=0}
[2017-03-16 14:14:52.798609] miral::Window Management: raise_tree root=Open File
[2017-03-16 14:14:52.798658] miral::Window Management: advise_raise window_info={Untitled , Open File}
[2017-03-16 14:14:52.798712] miral::Window Management: advise_raise window_info={Open File}
[2017-03-16 14:14:52.798833] miral::Window Management: advise_focus_lost window_info={name=Open File, type=dialog, state=restored, parent=Untitled , children={}, min_width=325, min_height=178, max_width=16777215, max_height=16777215, preferred_orientation=0xf, confine_pointer=0, output_id=0}

It looks as though miral is not handling the hiding of the child dialog correctly.

Changed in miral:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package miral - 1.3.1+17.04.20170316.1-0ubuntu1

---------------
miral (1.3.1+17.04.20170316.1-0ubuntu1) zesty; urgency=medium

  * New upstream release 1.3.1 (https://launchpad.net/miral/+milestone/1.3.1)
    - ABI summary:
      . miral ABI unchanged at 2
    - Enhancements:
      . [libmirclientcpp] RAII wrappers for MirBlob and MirCookie
      . spelling: SetWindowManagmentPolicy => SetWindowManagementPolicy
    - Bugs fixed:
      . [miral-shell] If a surface is deleted before its decoration is painted
        miral-shell can crash, or hang on exit (LP: #1673038)
      . [miral-shell] if the specified font doesn't exist the server crashes
        (LP: #1671028)
      . [libmiral] When a dialog is hidden ensure that the active window focus
        goes to the parent. (LP: #1671072)

 -- Alan Griffiths <email address hidden> Thu, 16 Mar 2017 18:17:41 +0000

Changed in miral (Ubuntu):
status: New → Fix Released
Changed in miral:
status: Fix Committed → Fix Released
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: Triaged → In Progress
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

qtmir sends a key event to mir::scene::Surface->consume() without any modifiers but it still arrives with a modifier when it surfaces from the mir client lib in the client process.

Looks like some sort of key input validation in mir got confused and is adding the modifier back even though the key ctrl got released.

Changed in qtmir (Ubuntu):
status: Invalid → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Remember we use the 'Mir' project for tracking bugs primarily and not 'mir (Ubuntu)'. Although I don't know if either is actually relevant to this bug.

Changed in mir:
status: New → Incomplete
Changed in mir (Ubuntu):
status: New → Incomplete
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

"""
Remember we use the 'Mir' project for tracking bugs primarily and not 'mir (Ubuntu)'.
"""

unity8 & friends use an opposite policy.

"""
Although I don't know if either is actually relevant to this bug.
"""

My understanding is that XKBMapper::modifier_state on the client side failing to update as expected and is therefore getting stuck with a ctrl modifier

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Turns out mir client got confused because the key release events sent by unity8 where missing device id and timestamp.

Changed in mir (Ubuntu):
status: Incomplete → Invalid
Changed in mir:
status: Incomplete → Invalid
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
milestone: u8c-1 → u8c-z
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unity8 - 8.15+17.04.20170328.3-0ubuntu1

---------------
unity8 (8.15+17.04.20170328.3-0ubuntu1) zesty; urgency=medium

  [ Albert Astals Cid ]
  * mock: Remove empty property and move invokable
  * Tune quicklist item selection
  * Fix unminimizing going to the wrong position the second time (LP:
    #1671458)
  * Remove unclickable gaps on the menubar (LP: #1672722)
  * indicators client is a tool
  * Make sure we destroy the popups when the item goes away (LP:
    #1670338)
  * UnityApplicationMocks: Initialize m_state and m_requestedState
  * Don't use appInfo after checking it if is null
  * Initialize m_privateMode
  * Hook up aboutToShow for overflow menus (LP: #1676016)

  [ Daniel d'Andrada ]
  * Give active focus to child surface qml items (LP: #1671072)
  * Satellite child windows (LP: #1673415)
  * Tell qtmir/miral about the available desktop area

  [ Florian Boucault ]
  * WindowStateStorage: use a private QThreadPool to ensure that
    WindowStateStorage::saveValue always has a thread available to
    execute the query in. (LP: #1675424)

  [ Lukáš Tinkl ]
  * Protect against loading invalid window geometry (LP: #1674262)
  * Remove usage of the deprecated (and non-functional) system-image-
    dbus service.
  * Implement Ctrl+Alt+T to launch the terminal app (LP: #1673500)
  * Only take normal and dialog surface types into account for launcher
    items (LP: #1669047)
  * Fix the shutdown dialog after recent refactoring in
    DBusUnitySessionService (LP: #1676426)

  [ Michael Zanetti ]
  * drop the grey background behind icons in the drawer (LP: #1675688)

  [ Pete Woods ]
  * Fix Unity/Platform::isPC, and add tests (LP: #1670657)

 -- Michał Sawicz <email address hidden> Tue, 28 Mar 2017 21:50:20 +0000

Changed in unity8 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtmir - 0.5.1+17.04.20170328-0ubuntu1

---------------
qtmir (0.5.1+17.04.20170328-0ubuntu1) zesty; urgency=medium

  [ Alan Griffiths ]
  * MirAL will be correcting another spelling error shortly. Avoid an
    FTBFS when that happens.
  * Compatibility with lp:mir and lp:~alan-griffiths/miral/1.3

  [ Albert Astals Cid ]
  * Remove empty property and move invokable
  * Run ApplicationManager::authorizeSession in the calling thread (LP:
    #1525285)

  [ Andreas Pokorny ]
  * Report and consume exception that may occur on constructing a keymap
    (LP: #1557634)

  [ Daniel d'Andrada ]
  * Ensure the window that got a key down also gets the corresponding
    key up (LP: #1671072)

  [ Gerry Boland ]
  * Don't let a child window go offscreen because its parent moved
  * Add env var equivalent to desktop_file_hint

  [ Lukáš Tinkl ]
  * Raise (activate) windows when an app focus is requested (LP:
    #1672337)

 -- Michał Sawicz <email address hidden> Tue, 28 Mar 2017 17:14:50 +0000

Changed in qtmir (Ubuntu):
status: In Progress → Fix Released
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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