mouse is getting stuck on a phantom edge

Bug #1580774 reported by kevin gunn
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Fix Released
Critical
Michał Sawicz
Mir
Fix Released
High
Andreas Pokorny
0.22
Fix Released
High
Andreas Pokorny
0.23
Fix Released
High
Andreas Pokorny
mir (Ubuntu)
Fix Released
High
Unassigned
qtmir (Ubuntu)
Invalid
Critical
Gerry Boland
unity-system-compositor (Ubuntu)
Invalid
Undecided
Unassigned
unity8 (Ubuntu)
Invalid
Critical
Unassigned

Bug Description

frieza build 101/rc-proposed

Steps:
1. connect mouse & keyboard to M10
2. launch xchat
3. go full screen
4. mouse move around across the entirety of the screen (landscape)

expected: mouse can range over entire screen
actual: gets stuck moving right

note: i noticed it happening on xchat, but when changing focus to dash it was also continuing to happen

So, i kinda suspect this may be related to rotation maybe.
I do admit i did the full OOBE in portrait mode

Problem is also persisting across reboot.

Tags: lt-blocker

Related branches

Revision history for this message
kevin gunn (kgunn72) wrote :

@dandrader this looks really familiar to that bug last year in london that you and anpok worked on

Changed in canonical-devices-system-image:
milestone: none → 11
assignee: nobody → Michał Sawicz (saviq)
importance: Undecided → Critical
Changed in qtmir (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Daniel d'Andrada (dandrader)
Changed in unity8 (Ubuntu):
assignee: nobody → Andreas Pokorny (andreas-pokorny)
importance: Undecided → Critical
kevin gunn (kgunn72)
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Invalid for Mir. Unity8 does its own mouse movement and boundaries without using Mir's logic for that.

On a related note -- I found probably a very similar problem with touch: bug 1502805

Changed in mir (Ubuntu):
status: New → Invalid
Changed in mir:
status: New → Invalid
Revision history for this message
Michał Sawicz (saviq) wrote :

I would say it's not related to rotation per se, since the "edge" moves around, you're not always stuck at the same vertical line.

Changed in canonical-devices-system-image:
status: New → Triaged
tags: added: lt-blocker
Revision history for this message
Michał Sawicz (saviq) wrote :

The problem is introduced in:

qtmir_0.4.8+15.04.20160429.1

That is - DGU support in qtmir:

https://bazaar.launchpad.net/~mir-team/qtmir/trunk/revision/483

Changed in qtmir (Ubuntu):
status: New → Triaged
assignee: Daniel d'Andrada (dandrader) → Gerry Boland (gerboland)
Changed in unity8 (Ubuntu):
assignee: Andreas Pokorny (andreas-pokorny) → nobody
status: New → Invalid
Revision history for this message
Michał Sawicz (saviq) wrote :
Revision history for this message
Michał Sawicz (saviq) wrote :

Some debugging output from qtmir:

http://pastebin.ubuntu.com/16387328/

qtmir.mir.input: Received MirPointerEvent(x=1175,y=915,relative_x=145.75,relative_y=0)
qtmir.mir.input: Received MirPointerEvent(x=1243,y=915,relative_x=68.75,relative_y=0)
qtmir.mir.input: Unrecognized pointer event
qtmir.mir.input: Received MirPointerEvent(x=1181,y=1061,relative_x=-28.6186,relative_y=-2.60169)
qtmir.mir.input: Unrecognized pointer event
qtmir.mir.input: Received MirPointerEvent(x=1131,y=1058,relative_x=-78.1499,relative_y=-5.2086)
qtmir.mir.input: Received MirPointerEvent(x=1084,y=1056,relative_x=-47.501,relative_y=-2.64137)

The Unrecognized event must be "window leave", so USC thinking pointer left the unity8 window, so no more events are delivered.

You can also see that while the "invisible edge" doesn't always happen on the same x (weird!), there has to be a negative x delta before any other event is delivered (but no "window enter" event ¿?).

Revision history for this message
Michał Sawicz (saviq) wrote :

The suspicion is that USC/Mir are getting confused with pointer position when we start applying scale.

Revision history for this message
Michał Sawicz (saviq) wrote :

Reopening Mir as while unity8 is responsible for its own cursor, if it stops receiving events, it can't do much.

Changed in mir (Ubuntu):
status: Invalid → New
Changed in mir:
status: Invalid → New
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 unity-system-compositor (Ubuntu):
status: New → Confirmed
Revision history for this message
Gerry Boland (gerboland) wrote :

Looking at Mir's SurfaceInputDispatcher::deliver_pointer,

        auto target = find_target_surface(event_x_y);
        printf("input event target %p, pos: (%d,%d)\n", target.get(), event_x_y.x.as_int(), event_x_y.y.as_int());

prints this when hitting the barrier:
 input event target 0x562470, pos: (1177,323)
 input event target (nil), pos: (1213,323)
that is with mouse only about 300 pixels across the screen.

But I guess the real problem is that the Mir cursor coordinate is outside the physical display space, i.e. it should go beyond x=1200, and thus always be over the unity8 surface. Unity8 reads the cursor movement delta, not the position, to position its cursor

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

mi::DisplayInputRegion::confine(geom::Point& point) is responsible for confining the cursor position inside the display rectangles.

void ms::MediatingDisplayChanger::update_input_rectangles(mg::DisplayConfiguration const& config)
is that which configures DisplayInputRegion with the display rectangles.

phablet@frieza:~/lib$ mirout -- --desktop_file_hint=dialer-app
Connected to server: <default>
Card 0: Max 3 simultaneous outputs
Output 1: Card 0, LVDS, connected, 1200x1920+0+0, used, on, 135mm x 216mm (10.0"), normal
    1200x1920 56.90*+
Output 2: Card 0, DisplayPort, disconnected
Output 3: Card 0, Virtual, disconnected
    1920x1080 60.00*+

I am seeing the MediatingDisplayChanger consider the Virtual display as being included in the display rectangles, even though is is "disconnected".

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

There appears to be a problem with the DisplayConfiguration::power_mode flag in Mir.

I've added debug logging inside ms::MediatingDisplayChanger::update_input_rectangles to print the display configuration state. At startup, once unity8 starts, I see this output from USC:

http://pastebin.ubuntu.com/16393116/

The power modes are wrong, which causes Mir to think the virtual display's geometry should be included in the input region.

This patch is a quick fix, but not the correct one.
http://pastebin.ubuntu.com/16393164/
Instead need to figure out why the power mode is being incorrectly determined when Mir reconfigures displays on unity8 connect.

Michał Sawicz (saviq)
Changed in mir:
status: New → Confirmed
Changed in qtmir (Ubuntu):
status: Triaged → Incomplete
Changed in canonical-devices-system-image:
status: Triaged → In Progress
Changed in unity-system-compositor (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Gerry Boland (gerboland) wrote :

It possible QtMir mis-using the Mir DisplayConfiguration API. Here is our implementation:

http://bazaar.launchpad.net/~mir-team/qtmir/trunk/view/head:/src/platforms/mirserver/mirdisplayconfigurationpolicy.cpp#L51

Let me know if something obviously wrong

Changed in mir:
assignee: nobody → Andreas Pokorny (andreas-pokorny)
status: Confirmed → In Progress
milestone: none → 0.22.1
milestone: 0.22.1 → 0.23.0
milestone: 0.23.0 → 0.22.1
Changed in mir:
importance: Undecided → Critical
Changed in mir:
milestone: 0.22.1 → 0.24.0
Michał Sawicz (saviq)
Changed in qtmir (Ubuntu):
status: Incomplete → Invalid
Changed in unity-system-compositor (Ubuntu):
status: Incomplete → Invalid
Changed in mir (Ubuntu):
status: Confirmed → In Progress
Changed in mir:
importance: Critical → High
status: In Progress → Fix Committed
Changed in mir (Ubuntu):
importance: Undecided → High
Changed in canonical-devices-system-image:
status: In Progress → Fix Committed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Upstream release of Mir 0.22.1 with this fix completed. The fix is also in some PPAs but not yet Ubuntu distro.

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

mir (0.22.1+16.04.20160516.2-0ubuntu1) xenial; urgency=medium

  [ Andreas Pokorny ]
  * New upstream release 0.22.1 (https://launchpad.net/mir/+milestone/0.22.1)
    - ABI summary:
      . No ABI changes in any libraries. Bugfix release only.
    - Bugs fixed:
      . [regression] Cursor stops at phantom edge on M10 and N7 (LP: 1580774)

  [ CI Train Bot ]
  * No-change rebuild.

 -- Michał Sawicz <email address hidden> Mon, 16 May 2016 15:36:50 +0000

Changed in mir (Ubuntu):
status: Fix Committed → Fix Released
Changed in canonical-devices-system-image:
status: Fix Committed → 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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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