VirtualBox

Changeset 70007 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 8, 2017 10:07:36 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119531
Message:

FE/Qt: bugref:8694: X11: Adjusting VBoxGlobal::setTopLevelGeometry to be HiDPI aware and take host-screen scale-factor into account.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r69788 r70007  
    32743274         * our change request as an externally triggered one on success and not
    32753275         * at all if it is rejected. */
     3276        const double dDPR = gpDesktop->devicePixelRatio(pWidget);
    32763277        uint16_t fMask =   XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
    32773278                         | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
    3278         uint32_t values[] = { (uint32_t)x, (uint32_t)y, (uint32_t)w, (uint32_t)h };
     3279        uint32_t values[] = { (uint32_t)(x * dDPR), (uint32_t)(y * dDPR),
     3280                              (uint32_t)(w * dDPR), (uint32_t)(h * dDPR) };
    32793281        xcb_configure_window(QX11Info::connection(), (xcb_window_t)pWidget->winId(),
    32803282                             fMask, values);
     
    32833285                      | 2 /* XCB_ICCCM_SIZE_HINT_US_SIZE */
    32843286                      | 512 /* XCB_ICCCM_SIZE_P_WIN_GRAVITY */;
    3285         hints.x           = x;
    3286         hints.y           = y;
    3287         hints.width       = w;
    3288         hints.height      = h;
    3289         hints.min_width   = pWidget->minimumSize().width();
    3290         hints.min_height  = pWidget->minimumSize().height();
    3291         hints.max_width   = pWidget->maximumSize().width();
    3292         hints.max_height  = pWidget->maximumSize().height();
    3293         hints.width_inc   = pWidget->sizeIncrement().width();
    3294         hints.height_inc  = pWidget->sizeIncrement().height();
    3295         hints.base_width  = pWidget->baseSize().width();
    3296         hints.base_height = pWidget->baseSize().height();
     3287        hints.x           = x * dDPR;
     3288        hints.y           = y * dDPR;
     3289        hints.width       = w * dDPR;
     3290        hints.height      = h * dDPR;
     3291        hints.min_width   = pWidget->minimumSize().width() * dDPR;
     3292        hints.min_height  = pWidget->minimumSize().height() * dDPR;
     3293        hints.max_width   = pWidget->maximumSize().width() * dDPR;
     3294        hints.max_height  = pWidget->maximumSize().height() * dDPR;
     3295        hints.width_inc   = pWidget->sizeIncrement().width() * dDPR;
     3296        hints.height_inc  = pWidget->sizeIncrement().height() * dDPR;
     3297        hints.base_width  = pWidget->baseSize().width() * dDPR;
     3298        hints.base_height = pWidget->baseSize().height() * dDPR;
    32973299        hints.win_gravity = XCB_GRAVITY_STATIC;
    32983300        if (hints.min_width > 0 || hints.min_height > 0)
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