Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8158205

HiDPI hand cursor broken on Windows

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8u92, 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Environment:

      Windows7, hidpi display

    • Subcomponent:
    • Resolved In Build:
      b130
    • OS:
      windows_7

      Description

      Using Java 8u92 in HiDPI mode, on Windows 7, the hand cursor looks pixely. It appears to be shown in the wrong resolution.

      Using Java 9ea118 in HiDPI mode, on Windows 7, it's not possible to switch to the hand cursor (using the code below). The regular cursor is shown.

      The same code works fine in standard DPI mode using either Java 8 or 9.

      Code:

      import javax.swing.*;
      import java.awt.*;

      public class HandCursorTest {

          public static void main(final String[] args) {
              final JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              SwingUtilities.invokeLater(() -> {
                  frame.setBounds(200, 200, 200, 200);
                  frame.getContentPane().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                  frame.setVisible(true);
              });
          }
      }

      Reproduce
      Run the code on a Windows 7 computer in HiDPI mode and move the mouse cursor over the window.

      Expected
      The mouse cursor should change the to the pre-defined Hand cursor using the system resolution.

      Actual
      8u92: Wrong resolution Hand cursor image.
      9ea118: Cursor does not change.

      The failure may also occur on Windows 8 and 10 (untested).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rchamyal Rajeev Chamyal (Inactive)
                Reporter:
                hschreiber Hendrik Schreiber
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: