VirtualBox

Ignore:
Timestamp:
Feb 3, 2016 4:04:52 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
105381
Message:

FE/Qt: bugref:7985: Mac OS X: Runtime UI: UI Session: Adjust the backing-scale factor for cursor for HiDPI screens when unscaled HiDPI output is used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r59412 r59572  
    17221722    }
    17231723
     1724    /* Create cursor-pixmap from the image: */
     1725    QPixmap cursorPixmap = QPixmap::fromImage(image);
     1726# ifdef Q_WS_MAC
     1727#  ifdef VBOX_GUI_WITH_HIDPI
     1728    /* Adjust-backing-scale-factor: */
     1729    // TODO: In case of multi-monitor setup check whether backing-scale factor and cursor are screen specific.
     1730    /* Get screen-id of main-window: */
     1731    const ulong uScreenID = machineLogic()->activeMachineWindow()->screenId();
     1732    /* Get backing-scale-factor: */
     1733    const double dBackingScaleFactor = frameBuffer(uScreenID)->backingScaleFactor();
     1734    /* Adjust-backing-scale-factor if necessary: */
     1735    if (dBackingScaleFactor > 1.0 && frameBuffer(uScreenID)->useUnscaledHiDPIOutput())
     1736        cursorPixmap.setDevicePixelRatio(dBackingScaleFactor);
     1737#  endif /* VBOX_GUI_WITH_HIDPI */
     1738# endif /* Q_WS_MAC */
    17241739    /* Set the new cursor: */
    1725     m_cursor = QCursor(QPixmap::fromImage(image), uXHot, uYHot);
     1740    m_cursor = QCursor(cursorPixmap, uXHot, uYHot);
    17261741    m_fIsValidPointerShapePresent = true;
    17271742    NOREF(srcShapePtrScan);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette