VirtualBox

Changeset 15512 in vbox for trunk


Ignore:
Timestamp:
Dec 15, 2008 3:49:37 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
40997
Message:

FE/Qt4-OSX: Enabled async window resizing for faster updates on resize events
(#3376).

Location:
trunk/src/VBox/Frontends/VirtualBox4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUtils.h

    r15493 r15512  
    217217void darwinDisableIconsInMenus();
    218218
     219/* Enable the async resize/move handling on Mac OS X */
     220void darwinEnableAsyncDragForWindow (QWidget *aWindow);
     221
    219222/* Experimental region handler for the seamless mode */
    220223OSStatus darwinRegionHandler (EventHandlerCallRef aInHandlerCallRef, EventRef aInEvent, void *aInUserData);
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp

    r15493 r15512  
    11971197                    doResizeHint (mNormalSize);
    11981198                }
     1199
     1200#ifdef Q_WS_MAC
     1201                /* Enable async resizing. */
     1202                ::darwinEnableAsyncDragForWindow (mMainWnd);
     1203#endif /* Q_WS_MAC */
    11991204
    12001205                return true;
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp

    r15467 r15512  
    258258    setWindowIcon (QIcon (":/VirtualBox_48px.png"));
    259259#endif
     260
     261#ifdef Q_WS_MAC
     262    /* Enable async resizing. */
     263    ::darwinEnableAsyncDragForWindow (this);
     264#endif /* Q_WS_MAC */
    260265
    261266    /* ensure status bar is created */
  • trunk/src/VBox/Frontends/VirtualBox4/src/darwin/VBoxUtils-darwin.cpp

    r15493 r15512  
    3535#include <QApplication>
    3636#include <QToolBar>
     37#include <QMainWindow>
     38#include <QStatusBar>
    3739
    3840#if QT_VERSION < 0x040400
     
    365367    QApplication::instance()->setAttribute (Qt::AA_DontShowIconsInMenus, true);
    366368#endif /* QT_VERSION >= 0x040400 */
     369}
     370
     371
     372void darwinEnableAsyncDragForWindow (QWidget *aWindow)
     373{
     374    WindowAttributes waGet;
     375    WindowAttributes waSet = kWindowAsyncDragAttribute;
     376    GetWindowAttributes (::darwinToWindowRef (aWindow), &waGet);
     377    if ((waGet & kWindowResizableAttribute) != kWindowResizableAttribute)
     378        waSet |= kWindowResizableAttribute;
     379    ChangeWindowAttributes (::darwinToWindowRef (aWindow), waSet, kWindowNoAttributes);
     380    /* Not working yet : */
     381//    ReshapeCustomWindow(::darwinToWindowRef (aWindow));
     382//    QMainWindow *mw = qobject_cast<QMainWindow *> (aWindow);
     383//    if (mw)
     384//    {
     385//        aWindow->setAttribute (Qt::WA_MacOpaqueSizeGrip, false);
     386//        mw->statusBar()->setSizeGripEnabled (true);
     387//    }
    367388}
    368389
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