Bug 92076 - Cannot move mouse pointer over the top 1080px along the Y axis when display is rotated vertically
Summary: Cannot move mouse pointer over the top 1080px along the Y axis when display i...
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: XWayland (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium critical
Assignee: Wayland bug list
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-22 16:22 UTC by Artem Chudinov
Modified: 2015-10-05 17:52 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
weston-launcher's log (6.95 KB, text/plain)
2015-09-22 16:22 UTC, Artem Chudinov
Details
weston.ini (868 bytes, text/plain)
2015-09-22 16:23 UTC, Artem Chudinov
Details
dmesg (49.15 KB, text/plain)
2015-09-22 16:24 UTC, Artem Chudinov
Details
Porposed fix (1.12 KB, patch)
2015-09-23 13:33 UTC, Olivier Fourdan
Details | Splinter Review

Description Artem Chudinov 2015-09-22 16:22:20 UTC
Created attachment 118399 [details]
weston-launcher's log

Display: Dell U2311H, 1920x1080@60.
Distro: Arch Linux i686
Linux 4.1.6-ck
Wayland 1.9.0
Weston 1.9.0
xorg-server 1.17.2-4
xorg-server-xwayland 1.17.2-4
libinput 1.0.1
xf86-input-libinput 0.14.0-3
Simple USB mouse A4Tech X7 F5
Mesa 11 (git, a1ac742)
 
I rotated my display vertically, so now my resolution is 1080x1920. (I use my display vertically almost always because it is very comfortable to read/write text/code when I can see a lot and scroll rarely).

When I open any X11 app (in Weston):
1. I can move successfully mouse pointer along the axis X (all of the 1080 pixels).
2. I can move successfully mouse pointer along the axis Y within only the top 1080 pixels (relative to the screen, not the window).
3. If I move mouse pointer below the top 1080px, the app (!) still thinks that Y=1080, though I (!) see that mouse pointer's Y is actually > 1080.
4. If I move the window to the bottom of the screen, then I can't click/scroll anything (Y relative to screen is > 1080) in it. I can't even move the window by clicking its title bar using the left mouse button. Though I can move the window by using Weston's Super+LMB.
Both xf86-video-ati and modesetting produce the same result.

I *think* there is something in the XWayland's code like:
max_cursor_y = maxResolutionHeight;
return min(cursor_y, max_cursor_y);
which should be changed to
max_cursor_y = (rotate_degree == 90 || rotate_degree == 270)
               ? max_resolution_width : max_resolution_height;
return min(cursor_y, max_cursor_y);

There is no such bug with mouse in X11 (I use it with libinput too).
Comment 1 Artem Chudinov 2015-09-22 16:23:19 UTC
Created attachment 118400 [details]
weston.ini
Comment 2 Artem Chudinov 2015-09-22 16:24:06 UTC
Created attachment 118401 [details]
dmesg
Comment 3 Olivier Fourdan 2015-09-23 07:54:40 UTC
Yeap, I can reproduce!
Comment 4 Olivier Fourdan 2015-09-23 13:33:34 UTC
Created attachment 118412 [details] [review]
Porposed fix

That patch seems sufficient to fix the issue for me, can you try it as well?
Comment 5 Artem Chudinov 2015-09-24 23:00:23 UTC
(In reply to Olivier Fourdan from comment #4)
> Created attachment 118412 [details] [review] [review]
> Porposed fix
> 
> That patch seems sufficient to fix the issue for me, can you try it as well?

Thank you! That patch fixed the issue for me too. I have tested (clicking, scrolling, moving/rotating/resizing windows, pasting text using a mouse wheel) Firefox 41, Chromium 45, Sublime Text 3, qBittorrent 3.2.3 (Qt 5.5), few apps through wine-staging 1.7.51.
Comment 6 Olivier Fourdan 2015-09-25 06:35:31 UTC
Thanks for testing, I posted your tested-by to the ML.
Comment 7 Olivier Fourdan 2015-10-05 17:52:38 UTC
Patch has been merged upstream, commit e31fe81: xwayland: Adjust screen size with rotation


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.