<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>1351</bug_id>
          
          <creation_ts>2017-02-18 10:35:20 +0100</creation_ts>
          <short_desc>NEWT: Custom pointer pixels doubled on High-DPI Retina Display on OS X only</short_desc>
          <delta_ts>2020-01-05 14:17:28 +0100</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Newt</product>
          <component>macosx</component>
          <version>2.4.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>macosx</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>1373</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="antoine.dutot@gmail.com">antoine.dutot</reporter>
          <assigned_to name="Sven Gothel">sgothel</assigned_to>
          
          
          <cf_type>DEFECT</cf_type>
          <cf_scm_refs></cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6027</commentid>
    <comment_count>0</comment_count>
    <who name="antoine.dutot@gmail.com">antoine.dutot</who>
    <bug_when>2017-02-18 10:35:20 +0100</bug_when>
    <thetext>Hi all,

When specifying a custom window pointer with Window.setPointerIcon() the pointer image is correct on HiDPI displays in Windows 10 (at 200% scale) and Linux but its size is doubled on MacOS X when using a retina display.

This does not happen on MacOS X on a standard, non HiDPI, display. 

The pointer is created like this :

win.setPointerIcon(win.getScreen().getDisplay().createPointerIcon(new PixelRectangle.GenericPixelRect(format, new Dimension(width, height), width*4, true, buffer, hotx, hoty))

Thanks a lot for your help.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6174</commentid>
    <comment_count>1</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2019-03-30 06:17:10 +0100</bug_when>
    <thetext>I assume this is a NEWT Window.
Set for version 2.5.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6512</commentid>
    <comment_count>2</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2020-01-05 04:16:27 +0100</bug_when>
    <thetext>tested w/ v2.4.0-rc-20200104
&lt;http://forum.jogamp.org/JogAmp-Jbeil-RC-Build-2-4-0-rc-20200104-td4040241.html&gt;

java -jar fat/jogamp-fat-test.jar
com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2SimpleNEWT

pressing &apos;c&apos; to change pointer to custom pointer/arrow icon and 
when I move the pointer out of the window (OSX icong)
and back in (custom icon) I see the same size.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6513</commentid>
    <comment_count>3</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2020-01-05 14:17:28 +0100</bug_when>
    <thetext>NEWT MacOS native code shows the pointer bitmaps are defined by pixelSize:

Java_jogamp_newt_driver_macosx_DisplayDriver_createPointerIcon0:

NSBitmapImageRep initWithBitmapDataPlanes(..,pixelsWide, pixelsHigh, ..) 
-&gt; NSImage  initWithCGImage(..)
-&gt; [[NSCursor alloc] initWithImage: nsImage hotSpot: hotP];

+++

Demo in comment 2 uses
- newt/data/pointer-grey-alpha-16x24.png
- arrow-red-alpha-64x64.png
- .. 

so: 16x24 and then all 64x64 sized bitmaps.

If at all, the pointer bitmap should be presented smaller in high-dpi mode
than expected, but this doesn&apos;t seem to be the case here.

Therefor the NSCursor seems to be upscaled by OSX to be same size.

some other discussions https://stackoverflow.com/questions/12021812/nscursor-images-on-a-retina-display


Please reopen this bug if you can reproduce and provide a unit test for me to reproduce this issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>