VirtualBox

Ignore:
Timestamp:
Jul 20, 2015 10:08:34 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101733
Message:

FE/Qt: 5978: Mini-toolbar: Use the common tool window flags for all hosts.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

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

    r56932 r57015  
    33273327                         pPropWidget->window()->winId());
    33283328}
    3329 
    3330 /* static */
    3331 void VBoxGlobal::representAsToolbar(QWidget *pWidget)
    3332 {
    3333     /* Get display: */
    3334     Display *pDisplay = pWidget->x11Info().display();
    3335 
    3336     /* Prepare a name of the property as the key: */
    3337     Atom net_wm_window_type = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE", false);
    3338     /* Prepare a type of the property as the value: */
    3339     Atom net_wm_window_type_toolbar = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_TOOLBAR", false);
    3340 
    3341     /* Populate values array: */
    3342     long data[1];
    3343     data[0] = net_wm_window_type_toolbar;
    3344 
    3345     /* Assign the property for the passed widget: */
    3346     XChangeProperty(pWidget->x11Info().display(),
    3347                     pWidget->window()->winId(),
    3348                     net_wm_window_type, XA_ATOM, 32,
    3349                     PropModeReplace, (unsigned char*)&data, 1L);
    3350 }
    33513329#endif /* Q_WS_X11 */
    33523330
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r56932 r57015  
    363363    /** X11: Ensures @a pPropWidget become transient for the @a pWidget. */
    364364    static void setTransientFor(QWidget *pWidget, QWidget *pPropWidget);
    365     /** X11: Represents @a pWidget as X11 tool-bar. */
    366     static void representAsToolbar(QWidget *pWidget);
    367365#endif /* Q_WS_X11 */
    368366
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r56935 r57015  
    5151                                           Qt::Alignment alignment,
    5252                                           bool fAutoHide /* = true */)
    53     : QWidget(pParent,
    54 #if   defined(Q_WS_WIN)
    55               Qt::Tool | Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint
    56 #elif defined(Q_WS_MAC) || defined(Q_WS_X11)
    57               Qt::Window | Qt::FramelessWindowHint
    58 #endif /* Q_WS_MAC || Q_WS_X11 */
    59               )
     53    : QWidget(pParent, Qt::Tool | Qt::FramelessWindowHint)
    6054    /* Variables: General stuff: */
    6155    , m_geometryType(geometryType)
     
    321315    if (QX11Info::isCompositingManagerRunning())
    322316        setAttribute(Qt::WA_TranslucentBackground);
    323 #endif /* Q_WS_X11 */
    324 
    325 #ifdef Q_WS_X11
    326     /* Certain WMs requires some X11 magic
    327      * to make tool-bar be always-on-top
    328      * of corresponding machine-window. */
    329     switch (vboxGlobal().typeOfWindowManager())
    330     {
    331         case X11WMType_Mutter:
    332         case X11WMType_GnomeShell:
    333             VBoxGlobal::representAsToolbar(this);
    334             break;
    335         default:
    336             break;
    337     }
    338317#endif /* Q_WS_X11 */
    339318
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