Mir

Merge lp:~albaguirre/mir/fix-1498540 into lp:mir

Proposed by Alberto Aguirre
Status: Merged
Approved by: Alberto Aguirre
Approved revision: no longer in the source branch.
Merged at revision: 2970
Proposed branch: lp:~albaguirre/mir/fix-1498540
Merge into: lp:mir
Diff against target: 30 lines (+7/-2)
2 files modified
src/server/input/display_input_region.cpp (+6/-1)
tests/unit-tests/input/test_display_input_region.cpp (+1/-1)
To merge this branch: bzr merge lp:~albaguirre/mir/fix-1498540
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Approve
Alexandros Frantzis (community) Approve
Review via email: mp+272198@code.launchpad.net

Commit message

Make DisplayInputRegion return only the first display view area.

Bounding all display view areas results in wrong touch screen coordinate scaling on most common
setups (phone/tablets/laptops that have a touchscreen in the primary display and support external displays).

Description of the change

Make DisplayInputRegion return only the first display view area.

Bounding all display view areas results in wrong touch screen coordinate scaling on most common
setups (phone/tablets/laptops that have a touchscreen in the primary display and support external displays).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

OK as a quick fix.

+ //TODO: This region is mainly used for scaling touchscreen coordinates, so the caller
+ // probably wants the full list of rectangles. Additional work is needed
+ // to group a touchscreen with a display.

+1

Should we be worried about the "mainly" part? What other uses does it currently have that may be affected by this change?

Mainly approve, but need some info :)

review: Needs Information
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

It's also used by mir::input::android::PointerController which passes the bounds to CursorInputMapper in the 3rd_party android input code. I don't quite understand what it does with the information however.

Testing on my laptop with mouse attached (which I would assume is a pointer controller?) dragging windows and clicking on both displays works just fine.

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

OK.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

It doesn't make things right, but arguably makes them less wrong.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/server/input/display_input_region.cpp'
2--- src/server/input/display_input_region.cpp 2015-04-28 07:54:10 +0000
3+++ src/server/input/display_input_region.cpp 2015-09-25 14:16:19 +0000
4@@ -46,7 +46,12 @@
5 });
6 });
7
8- return rectangles.bounding_rectangle();
9+ //TODO: This region is mainly used for scaling touchscreen coordinates, so the caller
10+ // probably wants the full list of rectangles. Additional work is needed
11+ // to group a touchscreen with a display. So for now, just return the view area
12+ // of the first display, as that matches the most common systems (laptops with touchscreens,
13+ // phone/tablets with touchscreens).
14+ return *rectangles.begin();
15 }
16
17 void mi::DisplayInputRegion::confine(geom::Point& point)
18
19=== modified file 'tests/unit-tests/input/test_display_input_region.cpp'
20--- tests/unit-tests/input/test_display_input_region.cpp 2015-06-25 03:00:08 +0000
21+++ tests/unit-tests/input/test_display_input_region.cpp 2015-09-25 14:16:19 +0000
22@@ -42,7 +42,7 @@
23
24 TEST(DisplayInputRegionTest, returns_correct_bounding_rectangle)
25 {
26- geom::Rectangle const expected_bounding_rect{geom::Point{0,0}, geom::Size{900,700}};
27+ geom::Rectangle const expected_bounding_rect{geom::Point{0,0}, geom::Size{800,600}};
28 auto stub_display = std::make_shared<mtd::StubDisplay>(rects);
29
30 mi::DisplayInputRegion input_region{stub_display};

Subscribers

People subscribed via source and target branches