sway icon indicating copy to clipboard operation
sway copied to clipboard

Duplicated cursor with rotated external display.

Open cedws opened this issue 6 years ago • 7 comments
trafficstars

Steps to produce:

  • Start Sway with a config that contains something like the following:
set $display_primary eDP-1
set $display_other DP-1

set $display_width 1920
set $display_height 1080

output $display_primary {
	pos 0 $display_height res $display_widthx$display_height
}

output $display_other {
	pos 0 0 res $display_widthx$display_height
}
  • Run swaymsg output [EXTERNAL_DISPLAY] transform 90 clockwise
  • Move your cursor to the external display
  • After moving it around horizontally, you should see a cursor duplicate across both displays

I tried to get a screenshot, but only one cursor is visible there.

cedws avatar Feb 27 '19 09:02 cedws

Can't produce with the default config. I've isolated the relevant parts of my config that cause the issue and added them above.

cedws avatar Feb 28 '19 14:02 cedws

Hi did you solve the problem? TLTR: Further observations and a workaround.

I have the same challenge putting two displays side by side in pivot mode

output DVI-I-1 res 1920x1080 transform 270 pos 0 0                                                         
output DP-1  res 1920x1080 transform 270 pos 1080 0     

This double mouse effect only happens, if transform is used. Setting transform to 0 for usual landscape mode works correctly. To be clear, I only see a double mouse. Frames are displayed correctly on both screens. Albeit, I see heavy flickering and focus point loosing sometimes, which I can get rid of moving the mouse cursor once to the other screen and back.

Furthermore, I noticed that a screenshot taken by grim shows that the frames overlap exactly in the way the double mouse cursors are present.

Finally, I changed the pos by trial and error to

output DVI-I-1 res 1920x1080 transform 270 pos 0 0                                                         
output DP-1  res 1920x1080 transform 270 pos 1210 0   

Whereas, the 1210 was a guess of the correct 1080 pixels offset + 130 pixels for the estimated overlap of the mouse cursor. This solved the problem of the "double cursor effect". I need to test further whether this also removes the flickering problems.

torwag avatar Feb 20 '20 09:02 torwag

Hey! I had this exact same issue before with sway 1.4, but it went away on its own, I'm guessing with a dependency upgrade.

minijackson avatar Jun 28 '20 15:06 minijackson

Manjaro Sway 21.1.0 (Kernel 5.10). In my case the reason of the double cursor was recalculation of the cursor position after connection the second (top) monitor.

output HDMI-A-1 res 1920x1080 pos 0 0
output eDP-1 res 1920x1080 pos 0 1080

I changed it to

output HDMI-A-1 res 1920x1080 pos 0 -1080
output eDP-1 res 1920x1080 pos 0 0

and the problem is gone. Thanks @torwag for pointing in the right direction, I suffered from this problem for several months :)

koynoyno avatar Aug 15 '21 03:08 koynoyno

I have the same issue with my current configuration of 2 displays. One is in portrait mode and one is landscaped…

set $screen0            "DP-1"
set $screen1            "HDMI-A-1"

output $screen0 {
        mode [email protected]
        pos 0 0
        adaptive_sync on
}
output $screen1 { 
        pos 2560 0    
        transform 270
        scale 1.0
}

If I change the position of the screen, sure the cursor duplication problem is workarounded.—but it will remove the ability to move with the mouse cursor from one to the other screen. So sadly the workaround is not acceptable for me. I hope this bug will fix soon. Thanks

vansoest avatar Aug 15 '22 13:08 vansoest

I sometimes have this problem in one of my screen environments. Are you using kanshi by any chance?

I just could workaround the issue by restarting kanshi.

Sometimes, somehow the display placement I configured in kanshi is not applied correctly when moving between screen environments. As a result screens overlap, leading to two mouse cursors. I also see the effect in a screenshot I took using grimshot.

Edit: Also output of swaymsg -t get_outputs showed the failed positioning (0,0) which usually is performed with kanshi. Proper position was set after restarting kanshi.

holzingk avatar Oct 20 '22 19:10 holzingk

Can you post Sway debug logs?

emersion avatar Oct 21 '22 08:10 emersion

2022-12-07T21:44:07,256219849+01:00

This is how it looks. Just had the problem again. It's a bit hard to get the debug logs, since it very rarely occurs and I don't start sway with the debug flag.

From log output of journalctl I see those messages:

connector DP-2: Atomic commit failed (pageflip): Device or resource busy
connector eDP-1: Atomic commit failed (pageflip): Device or resource busy

holzingk avatar Dec 07 '22 20:12 holzingk