Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64719

macOS updating the drag cursor is not high-dpi aware for custom pixmaps

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.6
    • None
    • macOS, Qt 5.6.4 from git
    • macOS

      Although setting a drag cursor is high-dpi/retina aware, updating the cursor with supplied QPixmap is not.

      The problem is located in src/plugins/cocoa/qnsview.mm - 

      updateCursorFromDragResponse

      does not take into account the devicePixleRatio of the source pixmap.

      Here is the correct code (I also attach a "saved commit" which should work on 5.6.4).

      @@ -1960,7 +1960,9 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
          }
      }
      else {
      +   QSize pmDeviceIndependentSize = pixmapCursor.size() / pixmapCursor.devicePixelRatio();
          NSImage *nsimage = qt_mac_create_nsimage(pixmapCursor);
      +   [nsimage setSize : qt_mac_toNSSize(pmDeviceIndependentSize)];
          nativeCursor = [[NSCursor alloc] initWithImage:nsimage          hotSpot:NSZeroPoint];
          [nsimage release];
      }

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sorvig Morten Sørvig
            mnaydenov Mihail Naydenov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes