VirtualBox

Changeset 99381 in vbox for trunk


Ignore:
Timestamp:
Apr 12, 2023 2:58:56 PM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10407. Creating Wayland equivalents of some of the X11 only functions in NativeWindowSubsystem.

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

Legend:

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

    r99372 r99381  
    331331#ifdef VBOX_WS_X11
    332332    /* Check whether we have compositing manager running: */
    333     m_fCompositingManagerRunning = NativeWindowSubsystem::X11IsCompositingManagerRunning();
     333    m_fCompositingManagerRunning = NativeWindowSubsystem::IsCompositingManagerRunning(X11XServerAvailable());
    334334
    335335    /* Acquire current Window Manager type: */
    336     m_enmWindowManagerType = NativeWindowSubsystem::X11WindowManagerType();
     336    m_enmWindowManagerType = NativeWindowSubsystem::WindowManagerType(X11XServerAvailable());
    337337#endif /* VBOX_WS_X11 */
    338338
     
    30273027{
    30283028    return m_enmDisplayServerType == DisplayServerType_XWayland
    3029                                   || DisplayServerType_XOrg;
    3030 }
    3031 #endif
     3029        || m_enmDisplayServerType == DisplayServerType_XOrg;
     3030}
     3031#endif
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r99278 r99381  
    21142114{
    21152115#ifdef VBOX_WS_X11
    2116     /* Assign same name to both WM_CLASS name & class for now: */
    2117     NativeWindowSubsystem::X11SetWMClass(this, "VirtualBox Manager", "VirtualBox Manager");
     2116    NativeWindowSubsystem::SetWMClass(uiCommon().X11XServerAvailable(), this, "VirtualBox Manager", "VirtualBox Manager");
    21182117#endif
    21192118
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp

    r99372 r99381  
    6060
    6161
     62bool NativeWindowSubsystem::IsCompositingManagerRunning(bool fIsXServerAvailable)
     63{
     64    if (fIsXServerAvailable)
     65        return X11IsCompositingManagerRunning();
     66    return WaylandIsCompositingManagerRunning();
     67}
    6268bool NativeWindowSubsystem::X11IsCompositingManagerRunning()
    6369{
     
    6773    Atom atom_property_name = XInternAtom(pDisplay, "_NET_WM_CM_S0", True);
    6874    return XGetSelectionOwner(pDisplay, atom_property_name);
     75}
     76
     77bool NativeWindowSubsystem::WaylandIsCompositingManagerRunning()
     78{
     79    /// @todo implement
     80    return true;
     81}
     82
     83X11WMType NativeWindowSubsystem::WindowManagerType(bool fIsXServerAvailable)
     84{
     85    if (fIsXServerAvailable)
     86        return X11WindowManagerType();
     87    return WaylandWindowManagerType();
     88}
     89
     90X11WMType NativeWindowSubsystem::WaylandWindowManagerType()
     91{
     92    /// @todo implement
     93    return X11WMType_Unknown;
    6994}
    7095
     
    590615}
    591616
     617void NativeWindowSubsystem::SetWMClass(bool fIsXServerAvailable, QWidget *pWidget, const QString &strNameString, const QString &strClassString)
     618{
     619    if (fIsXServerAvailable)
     620        X11SetWMClass(pWidget, strNameString, strClassString);
     621    else
     622        WaylandSetWMClass(pWidget, strNameString, strClassString);
     623}
     624
    592625void NativeWindowSubsystem::X11SetWMClass(QWidget *pWidget, const QString &strNameString, const QString &strClassString)
    593626{
     
    614647}
    615648
     649void NativeWindowSubsystem::WaylandSetWMClass(QWidget *pWidget, const QString &strNameString, const QString &strClassString)
     650{
     651    Q_UNUSED(pWidget);
     652    Q_UNUSED(strNameString);
     653    Q_UNUSED(strClassString);
     654    /// @todo implement
     655}
     656
    616657void NativeWindowSubsystem::X11SetXwaylandMayGrabKeyboardFlag(QWidget *pWidget)
    617658{
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h

    r99372 r99381  
    104104namespace NativeWindowSubsystem
    105105{
     106    /** Wrapper function for X11IsCompositingManagerRunning and WaylandIsCompositingManagerRunning. */
     107    bool IsCompositingManagerRunning(bool fIsXServerAvailable);
    106108    /** X11: Determines and returns whether the compositing manager is running. */
    107109    bool X11IsCompositingManagerRunning();
     110    /** Wayland: Determines and returns whether the compositing manager is running. */
     111    bool WaylandIsCompositingManagerRunning();
     112
     113    /** Wrapper for window manager type functions. */
     114    X11WMType WindowManagerType(bool fIsXServerAvailable);
    108115    /** X11: Determines and returns current Window Manager type. */
    109116    X11WMType X11WindowManagerType();
     117    /** Wayland: Determines and returns current Window Manager type. */
     118    X11WMType WaylandWindowManagerType();
    110119
    111120    /** X11: Returns true if XLib extension with name @p extensionName is avaible, false otherwise. */
     
    132141    SHARED_LIBRARY_STUFF void X11SetSkipPagerFlag(QWidget *pWidget);
    133142
     143    /** Wrapper function for WMClass setters. */
     144    SHARED_LIBRARY_STUFF void SetWMClass(bool fIsXServerAvailable, QWidget *pWidget, const QString &strNameString, const QString &strClassString);
    134145    /** X11: Assigns WM_CLASS property for passed @a pWidget. */
    135146    SHARED_LIBRARY_STUFF void X11SetWMClass(QWidget *pWidget, const QString &strNameString, const QString &strClassString);
     147    /** Wayland: Assigns WM_CLASS property for passed @a pWidget. */
     148    SHARED_LIBRARY_STUFF void WaylandSetWMClass(QWidget *pWidget, const QString &strNameString, const QString &strClassString);
    136149
    137150    /** X11: Tell the WM we are well behaved wrt Xwayland keyboard-grabs. This will
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