VirtualBox

Changeset 75900 in vbox


Ignore:
Timestamp:
Dec 3, 2018 12:56:33 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9309: Windows host: Fixing clipping rectangle for HiDPI case (not the mouse capturing itself yet).

File:
1 edited

Legend:

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

    r75899 r75900  
    12381238
    12391239        /* Prepare clipping area: */
     1240        // WORKAROUND:
     1241        // Underlying ClipCursor call requires physical coordinates, not logical upscaled Qt stuff.
     1242        // But we will have to map to relative origin (to make logical=>physical conversion) first.
     1243        const double dDpr = gpDesktop->devicePixelRatio(m_windows.value(m_iMouseCaptureViewIndex));
     1244        const QRect screenGeometry = gpDesktop->screenGeometry(m_windows.value(m_iMouseCaptureViewIndex));
     1245        viewportRectangle.moveTo((viewportRectangle.topLeft() - screenGeometry.topLeft()) * dDpr + screenGeometry.topLeft());
     1246        viewportRectangle.setSize(viewportRectangle.size() * dDpr);
    12401247        RECT rect = { viewportRectangle.left() + 1, viewportRectangle.top() + 1, viewportRectangle.right(), viewportRectangle.bottom() };
    12411248        ::ClipCursor(&rect);
Note: See TracChangeset for help on using the changeset viewer.

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