VirtualBox

Changeset 97888 in vbox


Ignore:
Timestamp:
Dec 28, 2022 12:52:28 PM (2 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9898: X11: Migrating VBoxUtils bits to Qt6; Tested a bit on Linux host.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/platform/x11
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp

    r97867 r97888  
    613613}
    614614
    615 Display *NativeWindowSubsystem::X11GetDisplay(void)
    616 {
    617 #ifdef VBOX_IS_QT6_OR_LATER /** @todo qt6: ... */
    618     Display *pDisplay = nullptr;
     615Display *NativeWindowSubsystem::X11GetDisplay()
     616{
     617#ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */
     618    Display *pDisplay = 0;
    619619    if (qApp)
    620620    {
     
    630630}
    631631
    632 xcb_connection_t *NativeWindowSubsystem::X11GetConnection(void)
    633 {
    634 #ifdef VBOX_IS_QT6_OR_LATER /** @todo qt6: ... */
     632xcb_connection_t *NativeWindowSubsystem::X11GetConnection()
     633{
     634#ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */
     635    xcb_connection_t *pConnection = 0;
    635636    if (qApp)
    636637    {
    637638        QNativeInterface::QX11Application *pX11App = qApp->nativeInterface<QNativeInterface::QX11Application>();
    638639        if (pX11App)
    639             return pX11App->connection();
    640     }
    641     return NULL;
     640            pConnection = pX11App->connection();
     641    }
    642642#else
    643     return QX11Info::connection();
     643    xcb_connection_t *pConnection = QX11Info::connection();
    644644#endif
    645 }
    646 
    647 uint32_t NativeWindowSubsystem::X11GetAppRootWindow(void)
    648 {
    649 #ifdef VBOX_IS_QT6_OR_LATER /** @todo qt6: ... */
     645    Assert(pConnection);
     646    return pConnection;
     647}
     648
     649uint32_t NativeWindowSubsystem::X11GetAppRootWindow()
     650{
     651#ifdef VBOX_IS_QT6_OR_LATER /** QX11Info is replaced with QNativeInterface::QX11Application since qt6 */
    650652    Window idWindow = 0;
    651653    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
    652654    if (pDisplay)
    653         idWindow = DefaultRootWindow(pDisplay); /** @todo qt6: ?? */
     655        idWindow = DefaultRootWindow(pDisplay);
    654656    return idWindow;
    655657#else
     
    657659#endif
    658660}
    659 
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h

    r97867 r97888  
    130130    SHARED_LIBRARY_STUFF void X11SetXwaylandMayGrabKeyboardFlag(QWidget *pWidget);
    131131
    132     /** X11: Get the X11 display pointer. */
    133     SHARED_LIBRARY_STUFF struct _XDisplay *X11GetDisplay(void);
    134 
    135     /** X11: Get the X11 connection.   */
    136     SHARED_LIBRARY_STUFF struct xcb_connection_t *X11GetConnection(void);
    137 
    138     /** X11: Get the X11 root (desktop) window. */
    139     SHARED_LIBRARY_STUFF uint32_t X11GetAppRootWindow(void);
     132    /** X11: Gets the X11 display pointer. */
     133    SHARED_LIBRARY_STUFF struct _XDisplay *X11GetDisplay();
     134    /** X11: Gets the X11 connection. */
     135    SHARED_LIBRARY_STUFF struct xcb_connection_t *X11GetConnection();
     136    /** X11: Gets the X11 root (desktop) window. */
     137    SHARED_LIBRARY_STUFF uint32_t X11GetAppRootWindow();
    140138}
    141139
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