XWin cursor huge on one computer but normal on another

Jon TURNEY jon.turney@dronecode.org.uk
Mon Aug 4 15:30:00 GMT 2014

On 03/08/2014 15:32, Matt D. wrote:
> I primarily work on my workstation which has four 1080p monitors (three
> on the bottom with the fourth at center top) and for the longest time I
> thought that it this was a configuration error on my part; and perhaps
> it still it.
> The issue is that on my worksation, the cursor is huge and is sometimes
> even cropped for being too large. This is especially noticeable for
> applications like xterm and gedit.
> I think it might be a DPI or scaling issue due to my large screen size,
> however I've always explicitly defined "-dpi 96" in my xinit.
> I had thought that this was a known bug and hadn't thought much about it
> until I pulled up gedit on my laptop where I saw that the cursors were
> all fine. I thought that maybe I had different packages but even after
> copying my entire cygwin directory and startup scripts over, on my
> laptop it still shows cursors no larger than the default Windows size.
> Has anyone experienced this before?
This is pretty odd.  Not a known bug, or one that I think we have a had 
reported before.

I guess what you are seeing when you say the cursor is 'cropped' is the 
X cursor being truncated to fit in the Windows cursor size of 
GetSystemMetrics(SM_CXCURSOR) by GetSystemMetrics(SM_CYCURSOR)

The libXcursor checks various things [1] when choosing a cursor size, 
falling back to (smallest screen dimension/48), so I guess it's your 
large display causing this issue.

I'm not sure about the best way to fix this, but as a workaround for the 
moment, you might try setting the XCURSOR_SIZE env var to something 

You might like to try this small test program to confirm what's going on:

$ cat cursor.c
#include <X11/Xwindows.h>
#include <X11/Xcursor/Xcursor.h>

int main()
    Display *dpy = XOpenDisplay(NULL);
    int c = XcursorGetDefaultSize(dpy);
    printf("XcursorGetDefaultSize = %d\n", c);
    printf("GetSystemMetrics(SM_CXCURSOR) = %d\n", 
    printf("GetSystemMetrics(SM_CYCURSOR) = %d\n", 

$ gcc cursor.c  -o cursor -lXcursor -lX11

$ ./cursor
XcursorGetDefaultSize = 22
GetSystemMetrics(SM_CXCURSOR) = 32
GetSystemMetrics(SM_CYCURSOR) = 32

[1] http://cgit.freedesktop.org/xorg/lib/libXcursor/tree/src/display.c#n168

Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/

More information about the Cygwin-xfree mailing list