Summary: | [regression, bisected] Xorg 1.18.2 stray cursor appears when some applications are launched maximized on rotated display | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | xorg | Reporter: | Furkan <falaca> | ||||||||||||||||||
Component: | Server/DDX/Xorg | Assignee: | Xorg Project Team <xorg-team> | ||||||||||||||||||
Status: | RESOLVED FIXED | QA Contact: | Xorg Project Team <xorg-team> | ||||||||||||||||||
Severity: | normal | ||||||||||||||||||||
Priority: | medium | ||||||||||||||||||||
Version: | unspecified | ||||||||||||||||||||
Hardware: | x86-64 (AMD64) | ||||||||||||||||||||
OS: | Linux (All) | ||||||||||||||||||||
Whiteboard: | |||||||||||||||||||||
i915 platform: | i915 features: | ||||||||||||||||||||
Attachments: |
|
Description
Furkan
2016-03-15 20:45:14 UTC
Created attachment 122332 [details]
Photo of stray cursor
Please attach the Xorg log file corresponding to the problem. Created attachment 122334 [details]
Xorg log
Xorg log attached. I'm not sure what's going on with the tons of "GetModeLine" messages that are coming up.
Please also attach the output of xrandr --verbose when the problem occurs. (In reply to Furkan from comment #0) > I've also triggered it a couple of times by maximizing a shell window on my > rotated display. How do you trigger the maximize to reproduce it: Clicking the maximize button, moving the window to the top of the screen, using a keyboard shortcut, ... ? Can you reproduce it the other ways as well? To clarify, the cursor works correctly on the rotated display for some time before the stray cursor appears, right? Created attachment 122337 [details]
Xrandr
I think it might not actually have anything to do with maximizing a window - that could have just been a coincidence. I restarted lightdm a good 15-20 times now and most of the time the stray cursor just appears on its own, and sometimes it doesn't.
But I also noticed that in lightdm I almost always seem to have 2 cursors. When the login screen first loads, there is a cursor hovering over the password field. But then when I move my mouse, a second cursor appears from the edge between the two monitors (the original cursor stays stuck in its place).
I'm still unable to reproduce the problem, despite trying many things (went back to 1.18.2 from Git master, installed lightdm, ...). Does Option "SilkenMouse" "off" work around the problem by any chance? If not, can you try starting X without rotation and then finding a minimal recipe for making the stray cursor appear? E.g. is simply running something like xrandr --output DVI-0 --rotate left --output DVI-1 --right-of DVI-0 enough? Option "SilkenMouse" "off" doesn't solve the issue for me. Running the xrandr command doesn't seem to have any effect either. However, I booted up into an Ubuntu 16.04 live ISO and was able to reproduce the issue with about 5-10 minutes of work. I did that just to make sure that there wasn't something wrong with my particular configuration. Here are the steps that I followed: 1. Download the Ubuntu 16.04 daily image from here, and boot into it from a USB stick: http://cdimage.ubuntu.com/daily-live/current/ 2. Edit /etc/apt/sources.list and add the line "deb-src http://archive.ubuntu.com/ubuntu xenial main universe multiverse restricted" (to let us get the build dependencies for ddx) 3. Run "sudo add-apt-repository ppa:canonical-x/x-staging" (to upgrade from Xorg 1.18.1 to 1.18.2) 4. sudo apt-get update && sudo apt-get dist-upgrade 5. sudo apt-get build-dep xserver-xorg-video-radeon 6. sudo apt-get install git 7. Grab xf86-video-ati from git, and build/install it 8. Use the following /etc/X11/xorg.conf: Section "Device" Identifier "radeon" Driver "ati" Option "TearFree" "true" EndSection Section "Files" ModulePath "/opt/xorg/lib/xorg/modules,/usr/lib/xorg/modules" EndSection 9. Edit /etc/lightdm/lightdm.conf and remove the line "autologin-user=ubuntu" (this is mandatory, you won't be able to reproduce the bug without doing this). 10. Go to the display settings, and rotate your left monitor by 90 degrees. I haven't tested this yet with 1 monitor... only with 2. 11. Run "sudo service lightdm restart" 12. Move your mouse around, and remember where you leave your cursor. Now, log in with user name "ubuntu" and a blank password. After your desktop loads, you'll have a stray cursor right on the spot where you left your mouse before logging in. If this doesn't work on the first try, restart lightdm another 2-3 times for good measure. Now, if you copy "/home/ubuntu/.config/monitors.xml" to "/var/lib/lightdm/.config/monitors.xml" and restart lightdm again (so that your monitor is rotated by 90 degrees on the lightdm login screen as well), you'll notice that you'll now also have a stray cursor in the lightdm greeter, which is stuck hovering over the password field. Created attachment 122403 [details] [review] Bail from xf86_set_cursor_position if the HW cursor is hidden Does this xserver patch help by any chance? Created attachment 122404 [details]
gdb breakpoint commands
If the patch doesn't help, please attach gdb to the Xorg process before the problem occurs and execute the commands in this file (e.g. by passing -x gdb.txt when launching gdb), then reproduce the problem. It should generate a series of backtraces, please attach all of those.
I just tried your patch, and it seems to eliminate the problem - no more stray cursor, including on the lightdm greeter. I restarted lightdm a good 5-6 times to test it and so far, so good! I jumped the gun on this - I had accidentally patched 1.18.1, instead of 1.18.2. The problem is still present after having patched 1.18.2. Just to clarify, in case there is any confusion: When I set both /var/lib/lightdm/.config/monitors.xml AND /home/furkan/.config/lightdm.xml to enable rotation: (1) at the lightdm login screen, there is a stuck cursor on my primary monitor, over the password field, and (2) after logging in, the stuck cursor switches to my secondary (rotated, positioned to the left) monitor and is rotated. When I edit /var/lib/lightdm/,config/monitors.xml to disable rotation on the login screen, I'm unable to reproduce the issue. I have no stuck cursor either on the login screen or after logging in. With the Ubuntu 16.04 live ISO the behaviour was slightly different - with rotation disabled on the login screen, there was no stray cursor at the login screen, but it would still appear after logging in, and the position would be the same as where you last left the cursor on the login screen. So at the moment, I don't have a way of triggering the stuck cursor "on demand". I just restart lightdm and if it's there from the start, it stays there. But if it's not there, I don't know how to make it appear afterwards. So in that case I'm assuming the gdb output wouldn't be very useful, unless it was from the live ISO? Yes, please get the gdb output from the live ISO. Created attachment 122514 [details]
gdb output when reproducing issue in ubuntu live ISO
Here's the gdb output. I obtained it by attaching gdb right before logging in (i.e., before pressing "enter" in the lightdm password field).
The stray cursor is not present on the lightdm greeter (both monitors are set to normal rotation). After logging in, my left monitor goes into rotated mode, and the stray cursor appears on the right screen.
Created attachment 122515 [details]
gdb output with breakpoints at drmmode_hide/show_cursor
Created attachment 122516 [details]
gdb output with xorg 1.18.1
When I log in, my cursor gets placed at the edge between the two monitors. My left-hand side monitor has a 1920x1200 resolution, and since it's rotated that means the cursor should be around x=1200. I noticed from the gdb logs above that miPointerSetCursorPosition is being called with x=1919, which of course is wrong.
I reverted to xorg 1.18.1 and ran gdb with the same breakpoints. As you can see, miPointerSetCursorPosition is now being called with x=1199, which is the correct position.
After staring at your logs and scratching my head for a while, it finally occurred to me what's happening, and I was able to reproduce it and come up with a fix: https://patchwork.freedesktop.org/patch/78155/ Sorry about those gdb log files - I didn't realize that gdb was appending to the log file instead of overwriting it. I don't know if you ended up figuring it out, but for each attachment, you'll only want to look at the very last gdb session. If you end up having to look at them again, just search for the 2nd last 'Thread 1 "Xorg" received signal SIGINT, Interrupt.' and ignore everything above that. I just rebuilt xserver with your patch, and it seems to have fixed the issue. I'll continue to use it and report back if I notice any problems... Fixed in master: commit 418fe365b45a143680d3b4143dc60f7cdc5a3507 Author: Michel Dänzer <michel.daenzer@amd.com> Date: Thu Mar 24 17:34:23 2016 +0900 xfree86/modes: Make sure the HW cursor is hidden when it should be |
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.