Mir

Mir does not reset key states when paused or resumed (modifiers get stuck after VT switching)

Bug #1536279 reported by Andreas Pokorny
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
Medium
Stephen M. Webb
Mir
Fix Released
High
Andreas Pokorny
mir (Ubuntu)
Fix Released
Medium
Unassigned
qtmir (Ubuntu)
Fix Released
Undecided
Andreas Pokorny

Bug Description

Mir switches away from the current VT when ALT+FXX is pressed. During that key sequence the alt modifier is pressed. While away and mir does not receive the alt release. When you switch back to mir there is a chance that mir is not receiving the alt release either.

So switching away and back to mir makes the alt key stick...

Proposed solution:
- track regular keys in mir::input::Seat or in SurfaceDispatcher
- inform client(s) about pause / resume with a focus lost / focus gain event
- attach key state to focus event or send separate key state event
- adapt gdk/qt backends
- fix alt key tracking in unity8 to rely on the provided modifier state

Tags: input

Related branches

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Technically correct, but understandably annoying.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Come to think of it, one would usually act on the release of the Fxx key in Alt+Fxx and never care about the release of the Alt key.

We shouldn't be looking for modifier events at all. Only release events of non-modifiers (at which point you also query what modifiers are presently held).

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Is there any way we can support Qt without tracking the modifier press/releases ourselves? Normally in app development the robust solution is comment #2. So you never need to track the modifier state, but just query it as required. But I understand there might be Qt design issues necessitating this... (?)

tags: added: input
Revision history for this message
Andrea Bernabei (faenil) wrote :

Just a practical consequence of this bug:

- taking screenshots using PrintScr or volup+voldown stops working after console switching

Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
assignee: nobody → Stephen M. Webb (bregma)
Changed in canonical-devices-system-image:
status: New → Confirmed
importance: Undecided → Medium
Changed in mir:
milestone: none → 0.22.0
assignee: nobody → Andreas Pokorny (andreas-pokorny)
Changed in mir:
status: New → In Progress
description: updated
description: updated
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

ok seems that getting the initial state is harder than expected.. it should be sufficient to just inform a nested server ~ via focus lost/gained.

description: updated
Changed in mir:
milestone: 0.22.0 → 0.23.0
Kevin DuBois (kdub)
Changed in mir:
milestone: 0.23.0 → 0.24.0
Kevin DuBois (kdub)
Changed in mir:
milestone: 0.24.0 → 0.25.0
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in mir (Ubuntu):
status: New → Confirmed
Changed in mir:
importance: Undecided → Medium
Changed in mir (Ubuntu):
importance: Undecided → Medium
Changed in mir:
milestone: 0.25.0 → 0.26.0
Changed in mir:
milestone: 0.26.0 → 1.0.0
summary: - Mir does not reset key states when paused or resumed
+ Mir does not reset key states when paused or resumed (modifiers get
+ stuck after VT switching)
Changed in mir:
importance: Medium → High
Changed in qtmir:
assignee: nobody → Andreas Pokorny (andreas-pokorny)
status: New → Confirmed
Changed in qtmir:
status: Confirmed → In Progress
Michał Sawicz (saviq)
affects: qtmir → qtmir (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  [ Alan Griffiths ]
  * Reduce dependencies on mirserver by reworking
    ../Application/mirbuffersgtexture.cpp and
    ../Application/surfacemanager.cpp

  [ Andreas Pokorny ]
  * Attach MirInputDeviceId and the MirCookie to input events (LP:
    #1536279, #1668692)

  [ Daniel d'Andrada ]
  * Implement MirSurface::allowClientResize (LP: #1670390)

  [ Gerry Boland ]
  * Stop MirSurface deleting itself, ensure SurfaceManager alone manages
    MirSurface lifetimes. Add SurfaceManager test suite. (LP: #1655644)
  * Extend timeouts when running under valgrind

  [ Albert Astals Cid, Gerry Boland ]
  * Check for find() result not being null before using it

 -- Michał Sawicz <email address hidden> Mon, 20 Mar 2017 21:16:34 +0000

Changed in qtmir (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 1.0.0

Changed in mir:
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (8.3 KiB)

This bug was fixed in the package mir - 0.27.0+17.10.20170630-0ubuntu1

---------------
mir (0.27.0+17.10.20170630-0ubuntu1) artful; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.27.0 (https://launchpad.net/mir/+milestone/0.27.0)
    - ABI summary:
      . mirclient ABI unchanged at 9
      . mirserver ABI bumped to 44
      . mircommon ABI unchanged at 7
      . mirplatform ABI bumped to 61
      . mirprotobuf ABI unchanged at 3
      . mirplatformgraphics ABI bumped to 13
      . mirclientplatform ABI unchanged at 5
      . mirinputplatform ABI bumped to 7
      . mircore ABI unchanged at 1
    - Enhancements:
      . Mostly groundwork required to support major enhancements coming in
        future Mir versions.
      . Removed android-input and eliminated the entire "3rd_party/" subtree.
        Now the Mir source tree contains original code only.
      . Added mir_prompt_session_new_fds_for_prompt_providers_sync API.
      . mirout: Added load and save options for keeping display configs
        on disk.
      . mirout: Added "--" support for applying configuration changes under
        Unity8.
      . Fixed failure of DRM hardware cursor {hide(); show(image);}
      . Added server option: "--cursor software" (MIR_SERVER_CURSOR=software)
      . Added letterboxing/black bars support to the GL renderer in preparation
        for generic output cloning.
      . Added client API for getting the logical size of an output.
      . Migrated MirCookie to use SHA-256.
      . Ensure RealKMSOutputConfiguration stays in sync with actual hardware
        state.
      . Added support for drag-and-drop.
      . Lots of other client API enhancements.
      . Minor clean-ups, optimizations and dead code removal.
      . Added support for building on Ubuntu 17.10 artful.
      . Update example code to use undeprecated API.
      . mesa-kms: Support hardware cursors in hybrid setups.
      . Rework and publish the graphics platform APIs
    - Bugs fixed:
      . [enhancement] Make able to get version information from client /
        server APIs (LP: #1195540)
      . Touch screen coordinates don't rotate with the screen (LP: #1349660)
      . Subpixel order not included in Mir display information (LP: #1393578)
      . [enhancement] Missing client API for relative surface movement (e.g.
        dragging client-decorated windows) (LP: #1420334) . Mir does not reset
        key states when paused or resumed (modifiers get stuck after VT
        switching) (LP: #1536279)
      . NBS never uses mc::MultiMonitorMode::single_monitor_fast, even when
        only a single monitor is plugged in (LP: #1561418)
      . Inconsistent behaviour of Num Lock (LP: #1588237)
      . A scaled (not panned or clipped) mirror/clone mode is desired
        (LP: #1639226)
      . Rotating an output left or right without restarting the
        compositor distorts the image (LP: #1643488)
      . support display scaling slider in unity8 (LP: #1645372)
      . [ FAILED ] NestedInputWithMouse.mouse_pointer_coordinates_in_nested_
        server_are_accumulated (LP: #1646375)
      . [ FAILED ] NestedInputWithMouse.mouse_pointer_position_is_in_sync_with_
        ho...

Read more...

Changed in mir (Ubuntu):
status: Confirmed → Fix Released
Changed in mir:
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.