Mir

Key events sent to the wrong client (and delayed)

Bug #1213804 reported by Daniel van Vugt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Alexandros Frantzis
mir (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Running several clients under mir_demo_server_shell, I can Alt+Tab between them and interact with each one. If I hit 'q' on a client which does not implement that key (or any keys), it is correctly ignored. However if I then Alt+Tab to a different client which does have keyboard handling, then that second client spuriously receives the 'q' event from a few seconds ago.

Tags: input

Related branches

Changed in mir:
status: New → Triaged
importance: Undecided → Medium
tags: added: input
Changed in mir:
importance: Medium → High
Revision history for this message
kevin gunn (kgunn72) wrote :

so will this be addressed via work on this bug
https://bugs.launchpad.net/mir/+bug/1194384

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

Nope, not related to bug 1194384. This bug is purely server-side. And the other bug is purely client-side.

Changed in mir:
assignee: nobody → Alexandros Frantzis (afrantzis)
status: Triaged → In Progress
Changed in mir:
milestone: none → 0.1.7
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Elaborate explanation of what is going on, using flicker as an app that doesn't handle input events, egltriangle as one that does handle input events.

1. User types 'q'.
2. q-down event is delivered to InputDispatcher (ID).
3. ID dispatches q-down event to currently focused window (flicker).
4. q-up event is delivered to ID.
5. ID tries to dispatch q-up event to flicker, but doesn't do so
   because a reply for a previous event (q-down) hasn't arrived.
   q-up is marked as 'pending'.
6. User types Alt-Tab.
7. Alt-Tab is delivered to ID, and it's immediately handled
   through the event filter before it reaches the input queue,
   leading to a change of focus to egltriangle.
8. ID retries sending q-up to the currently focused window,
   which is now egltriangle, and succeeds.

Note that we could get into the same situation if flicker handled events normally but for some reason delayed sending the event acknowledgements. So the input stack inherently assumes that apps will respond in a somewhat timely manner, in order to deliver expected behavior and optimizations.

Possible solutions:

1. Make the clients well behaving, like for example in https://code.launchpad.net/~afrantzis/mir/always-consume-input-events-in-clients/+merge/209313

2. Improve server behavior, like for example in https://code.launchpad.net/~afrantzis/mir/flush-input-queue-when-focusing-away-from-potentially-unresponsive-window/+merge/209659 .

3. Do nothing, assume that normal clients will be well behaving since they will handle events by default.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:mir/devel at revision None, scheduled for release in mir, milestone Unknown

Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
status: Fix Committed → Fix Released
Changed in mir (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package mir - 0.1.7+14.04.20140317.1-0ubuntu1

---------------
mir (0.1.7+14.04.20140317.1-0ubuntu1) trusty; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.1.7 (https://launchpad.net/mir/+milestone/0.1.7)
    - mirserver ABI bumped to 17
    - mirclient ABI unchanged, still at 7. Clients do not need rebuilding.
    - Server API changes (AKA why doesn't my code build any more?):
      . Class "CompositingCriteria" has been removed. It's replaced by the more
        flexible "Renderable" interface. This also resulted in parameter
        changes for the Renderer and scene filtering classes.
      . The function "DisplayConfiguration::configure_output()" has been
        removed. Instead, please use the new mutable version of
        "DisplayConfiguration::for_each_output()" with which you can modify
        the output structure passed in on each iteration.
      . Exposed formerly private class "GLRenderer" and demonstrated how
        to override its behaviour in demo-shell. This area is under
        construction and may experience further major changes.
    - Added initial support for hardware (HWC) overlays to accelerate
      rendering and reduce power consumption. Not complete yet.
    - Screen rotation: Added mouse cursor rotation support, so you can now
      still control things on a rotated screen. Still missing rotation of
      the cursor bitmap itself.
    - Lots of fixes to support nested Mir servers (see below).
    - Major simplification to how surface size/position/transformation
      interact, making transformations much easier to manage and work with.
    - Bugs fixed:
      . ./cross-compile-chroot.sh: line 83: popd: build-android-arm: invalid
        argument popd: usage: popd [-n] [+N | -N] (LP: #1287600)
      . Key events sent to the wrong client (and delayed) (LP: #1213804)
      . Nested servers never receive input events (in their filters)
        (LP: #1260612)
      . Software clients crash immediately on nested servers - what(): Failed
        to mmap buffer (LP: #1261286)
      . MirMotionEvent lacks local coordinates. Reports only screen
        coordinates. (LP: #1268819)
      . Nested Mir crashes with - what():
        MesaNativePlatform::create_internal_client is not implemented yet!
        (LP: #1279092)
      . clients fail to find some libraries if mir installed via "make install"
        (LP: #1285566)
      . Nested server hangs with multimonitor and internal clients.
        (LP: #1287282)
      . [regression] Multi-monitor frame sync no longer works (not
        synchronized), and frames skip/jump/stutter (LP: #1288570)
      . Mir FTBFS: /usr/bin/ld: cannot find -lmirtestdraw (when cmake ..
        -DMIR_ENABLE_TESTS=OFF) (LP: #1283951)
      . nested Mir library calls next_buffer() during startup (LP: #1284739)
      . Building Mir produces lots of warnings from GLM headers about
        deprecated degrees values vs radians (LP: #1286010)
      . [enhancement] screencast of a single window (LP: #1288478)
      . Nexus4 + mir_demo_client_eglplasma starts to stutter after a while
        (LP: #1189753)
      . --host-socket documented default argument isn't...

Read more...

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