VirtualBox

Changeset 62929 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 3, 2016 3:55:42 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8505: X11: Selector UI: Do not save/restore normal/scaled geometry for the zero/fake screen case; Restore window geometry on available area changes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r62682 r62929  
    2929# if QT_VERSION >= 0x050000
    3030#  include <QStandardPaths>
     31#  ifdef VBOX_WS_X11
     32#   include <QDesktopWidget>
     33#  endif /* VBOX_WS_X11 */
    3134# else /* QT_VERSION < 0x050000 */
    3235#  include <QDesktopServices>
     
    135138}
    136139
     140#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
     141void UISelectorWindow::sltHandleHostScreenAvailableAreaChange()
     142{
     143    /* Prevent handling if fake screen detected: */
     144    if (vboxGlobal().isFakeScreenDetected())
     145        return;
     146
     147    /* Restore the geometry cached by the window: */
     148    resize(m_geometry.size());
     149    move(m_geometry.topLeft());
     150}
     151#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     152
    137153void UISelectorWindow::sltShowSelectorWindowContextMenu(const QPoint &position)
    138154{
     
    10661082        case QEvent::Resize:
    10671083        {
     1084#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
     1085            /* Prevent handling if fake screen detected: */
     1086            if (vboxGlobal().isFakeScreenDetected())
     1087                break;
     1088#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     1089
    10681090            if (isVisible() && (windowState() & (Qt::WindowMaximized | Qt::WindowMinimized | Qt::WindowFullScreen)) == 0)
    10691091            {
     
    10751097        case QEvent::Move:
    10761098        {
     1099#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
     1100            /* Prevent handling if fake screen detected: */
     1101            if (vboxGlobal().isFakeScreenDetected())
     1102                break;
     1103#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     1104
    10771105            if (isVisible() && (windowState() & (Qt::WindowMaximized | Qt::WindowMinimized | Qt::WindowFullScreen)) == 0)
    10781106            {
     
    16951723void UISelectorWindow::prepareConnections()
    16961724{
     1725#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
     1726    /* Desktop event handlers: */
     1727    connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(sltHandleHostScreenAvailableAreaChange()));
     1728#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
     1729
    16971730    /* Medium enumeration connections: */
    16981731    connect(&vboxGlobal(), SIGNAL(sigMediumEnumerationFinished()), this, SLOT(sltHandleMediumEnumerationFinish()));
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r62493 r62929  
    6666
    6767private slots:
     68
     69#if defined(VBOX_WS_X11) && QT_VERSION >= 0x050000
     70    /** Handles host-screen available-area change. */
     71    void sltHandleHostScreenAvailableAreaChange();
     72#endif /* VBOX_WS_X11 && QT_VERSION >= 0x050000 */
    6873
    6974    /** Handles selector-window context-menu call for passed @a position. */
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