VirtualBox

Changeset 65797 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Feb 16, 2017 9:34:40 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: X11: Runtime UI: Mini-toolbar workaround for WMs which don't support transiency between full-screen frame-less windows.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r65554 r65797  
    399399*********************************************************************************************************************************/
    400400
     401/* static */
     402Qt::WindowFlags UIMiniToolBar::defaultWindowFlags(GeometryType geometryType)
     403{
     404    /* Not everywhere: */
     405    Q_UNUSED(geometryType);
     406
     407#ifdef VBOX_WS_X11
     408    /* Depending on current WM: */
     409    switch (vboxGlobal().typeOfWindowManager())
     410    {
     411        // WORKAROUND:
     412        // By strange reason, frameless full-screen windows under certain WMs
     413        // do not respect the transient relationship between each other.
     414        // By nor less strange reason, frameless full-screen *tool* windows
     415        // respects such relationship, so we are doing what WM want.
     416        case X11WMType_GNOMEShell:
     417        case X11WMType_Metacity:
     418        case X11WMType_Mutter:
     419            printf("hack\n");
     420            return geometryType == GeometryType_Full ?
     421                   Qt::Tool | Qt::FramelessWindowHint :
     422                   Qt::Window | Qt::FramelessWindowHint;
     423        default: break;
     424    }
     425#endif /* VBOX_WS_X11 */
     426
     427    /* Frameless window by default: */
     428    return Qt::Window | Qt::FramelessWindowHint;
     429}
     430
    401431UIMiniToolBar::UIMiniToolBar(QWidget *pParent,
    402432                             GeometryType geometryType,
    403433                             Qt::Alignment alignment,
    404434                             bool fAutoHide /* = true */)
    405     : QWidget(0, Qt::Window | Qt::FramelessWindowHint)
     435    : QWidget(0, defaultWindowFlags(geometryType))
    406436    /* Variables: General stuff: */
    407437    , m_pParent(pParent)
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.h

    r65553 r65797  
    6666
    6767public:
     68
     69    /** Proposes default set of window flags for particular platform. */
     70    static Qt::WindowFlags defaultWindowFlags(GeometryType geometryType);
    6871
    6972    /** Constructor, passes @a pParent to the QWidget constructor.
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