VirtualBox

Changeset 81826 in vbox


Ignore:
Timestamp:
Nov 13, 2019 1:36:00 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134617
Message:

FE/Qt: bugref:9598: x11: Adjust mouse integration pointer according to device-pixel-ratio and GUI scale-factor.

File:
1 edited

Legend:

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

    r81736 r81826  
    18441844    m_cursorPixmap = QPixmap::fromImage(image);
    18451845    updateMousePointerPixmapScaling(m_cursorPixmap, uXHot, uYHot);
    1846 
    1847 # if defined(VBOX_WS_X11)
    1848     /* Adjust device-pixel-ratio: */
    1849     /// @todo In case of multi-monitor setup check whether device-pixel-ratio and cursor are screen specific.
    1850     /* Get screen-id of main-window: */
    1851     const ulong uScreenID = activeMachineWindow()->screenId();
    1852     /* Get device-pixel-ratio: */
    1853     const double dDevicePixelRatio = frameBuffer(uScreenID)->devicePixelRatio();
    1854     /* Adjust device-pixel-ratio if necessary: */
    1855     if (dDevicePixelRatio > 1.0 && !frameBuffer(uScreenID)->useUnscaledHiDPIOutput())
    1856     {
    1857         uXHot *= dDevicePixelRatio;
    1858         uYHot *= dDevicePixelRatio;
    1859         m_cursorPixmap = m_cursorPixmap.scaled(m_cursorPixmap.width() * dDevicePixelRatio, m_cursorPixmap.height() * dDevicePixelRatio,
    1860                                                Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    1861     }
    1862 # endif /* VBOX_WS_X11 */
    1863 
    1864     /* Set the new cursor: */
    18651846    m_cursor = QCursor(m_cursorPixmap, uXHot, uYHot);
    18661847    m_fIsValidPointerShapePresent = true;
     
    19101891    }
    19111892
    1912 #elif defined(VBOX_WS_WIN)
     1893#elif defined(VBOX_WS_WIN) || defined(VBOX_WS_X11)
    19131894
    19141895    /* Get screen-id of active machine-window: */
     
    19261907
    19271908    /* Take into account device-pixel-ratio if necessary: */
     1909# ifdef VBOX_WS_WIN
    19281910    const double dDevicePixelRatio = frameBuffer(uScreenID)->devicePixelRatio();
     1911# endif
    19291912    const double dDevicePixelRatioActual = frameBuffer(uScreenID)->devicePixelRatioActual();
    19301913    const bool fUseUnscaledHiDPIOutput = frameBuffer(uScreenID)->useUnscaledHiDPIOutput();
     
    19441927    }
    19451928
     1929# ifdef VBOX_WS_WIN
    19461930    /* If device pixel ratio was set: */
    19471931    if (dDevicePixelRatio > 1.0)
     
    19521936        uYHot /= dDevicePixelRatio;
    19531937    }
     1938# endif
    19541939
    19551940#else
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