public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jon.turney@dronecode.org.uk>
To: cygwin-xfree@cygwin.com
Cc: matt@codespunk.com
Subject: Re: XWin cursor huge on one computer but normal on another
Date: Mon, 04 Aug 2014 15:30:00 -0000	[thread overview]
Message-ID: <53DFA71C.4060809@dronecode.org.uk> (raw)
In-Reply-To: <53DE4801.3040209@codespunk.com>

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 
reasonable.

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", 
GetSystemMetrics(SM_CXCURSOR));
    printf("GetSystemMetrics(SM_CYCURSOR) = %d\n", 
GetSystemMetrics(SM_CYCURSOR));
}

$ 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/


      reply	other threads:[~2014-08-04 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-03 14:32 Matt D.
2014-08-04 15:30 ` Jon TURNEY [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53DFA71C.4060809@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-xfree@cygwin.com \
    --cc=matt@codespunk.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).