VirtualBox

Changeset 56932 in vbox


Ignore:
Timestamp:
Jul 14, 2015 2:43:45 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101639
Message:

FE/Qt: X11: 5978: Adjusting mini-toolbar z-order for Mutter a bit, some weird x11 magic.

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

Legend:

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

    r56929 r56932  
    33273327                         pPropWidget->window()->winId());
    33283328}
     3329
     3330/* static */
     3331void 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}
    33293351#endif /* Q_WS_X11 */
    33303352
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r56929 r56932  
    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);
    365367#endif /* Q_WS_X11 */
    366368
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp

    r55938 r56932  
    321321    if (QX11Info::isCompositingManagerRunning())
    322322        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            VBoxGlobal::representAsToolbar(this);
     333            break;
     334        default:
     335            break;
     336    }
    323337#endif /* Q_WS_X11 */
    324338
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