You are not logged in.

#1 2016-12-17 05:41:49

pied04
Member
Registered: 2011-05-20
Posts: 21

Cursor size problems when using second monitor

Sometimes I use a second monitor with my laptop, and I use xrandr to set up the displays.

When I turn on the second display (which is a high-resolution 4K display), I find that the cursor becomes very large on the windows that were in the active workspace when the second montior was turned on (I'm using xmonad), while staying normal size on others. This happens with all kinds of applications, like urxvt, emacs, and chrome.

I turn on the second monitor like this:

xrandr --output DP1 --auto --output eDP1 --auto --below DP1

How do I start debugging this? Where is the per-window cursor size stored and how can I reset it?

Offline

#2 2016-12-17 17:21:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Cursor size problems when using second monitor

I think you need to define the pixel pitch for the 4k display; at least that is where I would start.
What window manager/ desktop environment are you using?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2016-12-17 21:00:25

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Cursor size problems when using second monitor

xdpyinfo| grep resolution

before and after the 4k activation?
Try to enforce or reset the resolution.

Also elaborate on "too big" - it's maybe that the window is "too small" on one of the screens (but the cursor properly sized there)?

Offline

#4 2016-12-20 00:16:43

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

ewaller wrote:

What window manager/ desktop environment are you using?

I'm using xmonad with no desktop environment.

Offline

#5 2016-12-20 00:20:12

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

seth wrote:
xdpyinfo| grep resolution

before and after the 4k activation?

I get 96x96 dpi before and after activating the 4K display.

seth wrote:

Also elaborate on "too big" - it's maybe that the window is "too small" on one of the screens (but the cursor properly sized there)?

The window sizes all look fine -- my laptop screen is also a high dpi display and the windows appear about the same. For the cursor, it jumps between the "normal size" (similar to how it appears on my laptop normally) and a size that's about 2 times larger in each dimension, measured in pixels.

I'm trying to find a way to take a screenshot that includes the cursor but I'm having difficulty doing that!

seth wrote:

Try to enforce or reset the resolution.

I'll try this next.

Last edited by pied04 (2016-12-20 00:43:32)

Offline

#6 2016-12-20 09:23:05

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Cursor size problems when using second monitor

If your internal display is "high dpi", 96 dpi is a bit low, don't you think?
How is it set? Automatically determined, an entry to xorg.conf[.d] or at runtime?

Offline

#7 2016-12-20 14:11:00

Steinberg2010
Member
Registered: 2016-01-28
Posts: 73

Re: Cursor size problems when using second monitor

I have a similar problem with i3.

I have two monitors as well as my laptop display. If I use arandr to configure a layout like the following:

[ ][ ]
  []

The cursor becomes huge in X apps like libreoffice/web browser (but not in terminals etc.

If instead I configure a side by side layout:
[] [] []

I have no problems...

~S

Offline

#8 2016-12-21 01:12:09

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

seth wrote:

If your internal display is "high dpi", 96 dpi is a bit low, don't you think?
How is it set? Automatically determined, an entry to xorg.conf[.d] or at runtime?

You're right. I've never changed my X config so I guess it's automatically determined.

I calculated the true dpi of my laptop display (210) and tried doing:

xrandr --dpi 210

and then connecting the 4K display, but the large cursor problem is still there.

I can also say more exactly that *the cursor is large on applications that are started /after/ the 4K display has been connected*. e.g. if chrome was running before the 4K was connected, then the cursor is normal size on all chrome windows, even new ones, but if it was started for the first time after the new display was connected, then I get the large version.

Offline

#9 2016-12-21 07:52:51

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Cursor size problems when using second monitor

Steinberg2010's comment sounds like "some toolkit" takes a certain screen size limit as not-so-reliable indicator for a HiDPI setup and uses a different cursor size.
Do you also encounter this when using the second display "--same-as"?

Offline

#10 2017-01-03 05:38:11

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

seth wrote:

Do you also encounter this when using the second display "--same-as"?

Apologies for the slow reply. When I use just my laptop screen

xrandr --output eDP1 --auto --output DP1 --off

the cursor appears normal. When I use the 4K normally

xrandr --output DP1 --auto --output eDP1 --auto --below DP1

the cursor appears very large. When I do --same-as in either direction:

xrandr --output eDP1 --auto --output DP1 --same-as eDP1

or

xrandr --output DP1 --auto --output eDP1 --same-as DP1

the cursor is larger than normal but not as large as when I use the 4K normally.

Offline

#11 2017-01-03 06:18:15

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Cursor size problems when using second monitor

inplace of --below try using --right-of, (just to confirm that your error is same as Steinberg2010 or not)

Offline

#12 2017-01-04 01:49:46

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

Docbroke wrote:

inplace of --below try using --right-of, (just to confirm that your error is same as Steinberg2010 or not)

When I use --right-of (in either direction), I get the same result as using --same-as: the cursor size is larger than normal, although not as large as when I use --below.

Offline

#13 2017-01-04 08:09:27

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Cursor size problems when using second monitor

xrandr --output eDP1 --auto --scale 2x2 --output DP1 --off

Warning: the screen might get unreadable. You'll have a giant resolution in the internal output. How do cursors behave now (remember that everything is scaled down now, ie. tiny - if it's not tiny, it's actually huge ;-)

Offline

#14 2017-01-05 22:47:49

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

The cursor responds to the scaling. At scale 2x2 the cursor looks tiny. At about scale 0.4x0.4 it gets to be as big as when I have the second display on.

Offline

#15 2017-01-10 10:00:45

guiniol
Member
Registered: 2013-04-10
Posts: 18

Re: Cursor size problems when using second monitor

Glad to see I'm not going mad and others are seeing the same thing.
I updated my system yesterday, ran into some trouble with harfbuzz and infinality, removed infinality and now my cursor is huge.\

After some testing, the cursor size depends on the size of the virtual screen. I have three screens, with one vertical.
If I don't do any xrandr, then the mouse cursor is normal.
If I do my normal setup, the cursor is huge.
If I put two screens side by side and the third over one of the first two, then the cursor is bigger than normal but not as big as in my normal setup.
The cursor only appears big in windows started after the xrandr setup.

The only partial solution I've found is to specify

Xcursor*size

but that doesn't work on everything. Changing the size in gtk2/3 or qt seems to have no effect.
Has a bug report been filed?

EDIT: I use i3, with the numix-archblue theme and the adwaita cursor theme

EDIT2: Other apps seem to be using the wrong DPI, such as gpg-agent (gtk2, gtk3?), so it's probably the toolkit's fault.

EDIT3: I'm pretty sure it's gtk2 acting up. I'm currently trying to find a solution.

Last edited by guiniol (2017-01-16 18:13:41)

Offline

#16 2017-01-18 03:30:27

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

Another bizarre thing that's just started happening is the cursor now appearing *too small* on windows spawned while the 4K display is connected. It looks about half its usual size. I haven't worked out precisely what conditions cause this problem.

Offline

#17 2017-02-15 05:10:39

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

I can confirm that adding the line

Xcursor.size: 32

to my .Xresources has fixed this problem for me. All my usual applications (emacs, urxvt, chrome) now have a normal cursor size, regardless of whether the 4K monitor is connected.

Last edited by pied04 (2017-02-15 05:11:01)

Offline

#18 2017-02-15 19:17:54

guiniol
Member
Registered: 2013-04-10
Posts: 18

Re: Cursor size problems when using second monitor

pied04 wrote:

I can confirm that adding the line

Xcursor.size: 32

to my .Xresources has fixed this problem for me. All my usual applications (emacs, urxvt, chrome) now have a normal cursor size, regardless of whether the 4K monitor is connected.

Thanks for the tip.
What about font sizes? Are some applications using huge fonts?

Offline

#19 2017-02-16 03:52:17

pied04
Member
Registered: 2011-05-20
Posts: 21

Re: Cursor size problems when using second monitor

guiniol wrote:

What about font sizes? Are some applications using huge fonts?

Not in my case. The font sizes were not affected by the other monitor.

Offline

#20 2017-02-17 08:08:53

guiniol
Member
Registered: 2013-04-10
Posts: 18

Re: Cursor size problems when using second monitor

pied04 wrote:

Not in my case. The font sizes were not affected by the other monitor.

Lucky you ^^
I'm still looking for an acceptable solution.

Offline

Board footer

Powered by FluxBB