VirtualBox

Changeset 64398 in vbox


Ignore:
Timestamp:
Oct 24, 2016 3:26:55 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111508
Message:

bugref:8631: FE/Qt: resizing problems with tiling window managers: set additional hints and small clean-ups.

File:
1 edited

Legend:

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

    r64336 r64398  
    37043704}
    37053705
     3706#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    37063707typedef struct {
    37073708/** User specified flags */
     
    37263727uint32_t win_gravity;
    37273728} xcb_size_hints_t;
     3729#endif /* defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 */
    37283730
    37293731/* static */
    37303732void VBoxGlobal::setTopLevelGeometry(QWidget *pWidget, int x, int y, int w, int h)
    37313733{
     3734    AssertPtrReturnVoid(pWidget);
    37323735#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
    37333736# define QWINDOWSIZE_MAX ((1<<24)-1)
     
    37483751        hints.flags =   1 /* XCB_ICCCM_SIZE_HINT_US_POSITION */
    37493752                      | 2 /* XCB_ICCCM_SIZE_HINT_US_SIZE */;
    3750         hints.x          = x;
    3751         hints.y          = y;
    3752         hints.width      = w;
    3753         hints.height     = h;
    3754         hints.min_width  = pWidget->minimumSize().width();
    3755         hints.min_height = pWidget->minimumSize().height();
    3756         hints.max_width  = pWidget->maximumSize().width();
    3757         hints.max_height = pWidget->maximumSize().height();
     3753        hints.x           = x;
     3754        hints.y           = y;
     3755        hints.width       = w;
     3756        hints.height      = h;
     3757        hints.min_width   = pWidget->minimumSize().width();
     3758        hints.min_height  = pWidget->minimumSize().height();
     3759        hints.max_width   = pWidget->maximumSize().width();
     3760        hints.max_height  = pWidget->maximumSize().height();
     3761        hints.width_inc   = pWidget->sizeIncrement().width();
     3762        hints.height_inc  = pWidget->sizeIncrement().height();
     3763        hints.base_width  = pWidget->baseSize().width();
     3764        hints.base_height = pWidget->baseSize().height();
    37583765        if (hints.min_width > 0 || hints.min_height > 0)
    37593766            hints.flags |= 16 /* XCB_ICCCM_SIZE_HINT_P_MIN_SIZE */;
    37603767        if (hints.max_width < QWINDOWSIZE_MAX || hints.max_height < QWINDOWSIZE_MAX)
    37613768            hints.flags |= 32 /* XCB_ICCCM_SIZE_HINT_P_MAX_SIZE */;
     3769        if (hints.width_inc > 0 || hints.height_inc)
     3770            hints.flags |=   64 /* XCB_ICCCM_SIZE_HINT_P_MIN_SIZE */
     3771                           | 256 /* XCB_ICCCM_SIZE_HINT_BASE_SIZE */;
    37623772        xcb_change_property(QX11Info::connection(), XCB_PROP_MODE_REPLACE,
    37633773                            (xcb_window_t)pWidget->winId(), XCB_ATOM_WM_NORMAL_HINTS,
     
    37693779         * Configure event will arrive to tell Qt what geometry we want. */
    37703780        pWidget->setGeometry(x, y, w, h);
    3771 # else
     3781# else /* !defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 */
    37723782    pWidget->setGeometry(x, y, w, h);
    3773 # endif
     3783# endif /* !defined(VBOX_WS_X11) && QT_VERSION >= 0x050000 */
    37743784}
    37753785
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