Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp	(revision 94013)
@@ -19,4 +19,5 @@
 #include <QApplication>
 #include <QDesktopWidget>
+#include <QWidget>
 #include <QScreen>
 #ifdef VBOX_WS_WIN
@@ -25,5 +26,4 @@
 #ifdef VBOX_WS_X11
 # include <QTimer>
-# include <QX11Info>
 #endif
 
@@ -738,5 +738,5 @@
                          | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
         uint32_t values[] = { (uint32_t)(x * dDPR), (uint32_t)(y * dDPR), (uint32_t)(w * dDPR), (uint32_t)(h * dDPR) };
-        xcb_configure_window(QX11Info::connection(), (xcb_window_t)pWidget->winId(),
+        xcb_configure_window(NativeWindowSubsystem::X11GetConnection(), (xcb_window_t)pWidget->winId(),
                              fMask, values);
         xcb_size_hints_t hints;
@@ -764,8 +764,8 @@
             hints.flags |=   64 /* XCB_ICCCM_SIZE_HINT_P_MIN_SIZE */
                            | 256 /* XCB_ICCCM_SIZE_HINT_BASE_SIZE */;
-        xcb_change_property(QX11Info::connection(), XCB_PROP_MODE_REPLACE,
+        xcb_change_property(NativeWindowSubsystem::X11GetConnection(), XCB_PROP_MODE_REPLACE,
                             (xcb_window_t)pWidget->winId(), XCB_ATOM_WM_NORMAL_HINTS,
                             XCB_ATOM_WM_SIZE_HINTS, 32, sizeof(hints) >> 2, &hints);
-        xcb_flush(QX11Info::connection());
+        xcb_flush(NativeWindowSubsystem::X11GetConnection());
     }
     else
Index: /trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.cpp	(revision 94013)
@@ -23,6 +23,10 @@
 #include <QtXml/QDomDocument>
 #include <QtXml/QDomElement>
-#include <QX11Info>
 #include <QWidget>
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+# include <QGuiApplication>
+#else
+# include <QX11Info>
+#endif
 
 /* GUI includes: */
@@ -51,5 +55,5 @@
     /* For each screen it manage, compositing manager MUST acquire ownership
      * of a selection named _NET_WM_CM_Sn, where n is the screen number. */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     Atom atom_property_name = XInternAtom(pDisplay, "_NET_WM_CM_S0", True);
     return XGetSelectionOwner(pDisplay, atom_property_name);
@@ -59,5 +63,5 @@
 {
     /* Ask if root-window supports check for WM name: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     Atom atom_property_name;
     Atom atom_returned_type;
@@ -68,5 +72,5 @@
     X11WMType wmType = X11WMType_Unknown;
     atom_property_name = XInternAtom(pDisplay, "_NET_SUPPORTING_WM_CHECK", True);
-    if (XGetWindowProperty(pDisplay, QX11Info::appRootWindow(), atom_property_name,
+    if (XGetWindowProperty(pDisplay, NativeWindowSubsystem::X11GetAppRootWindow(), atom_property_name,
                            0, 512, False, XA_WINDOW, &atom_returned_type,
                            &iReturnedFormat, &ulReturnedItemCount, &ulDummy, &pcData) == Success)
@@ -86,4 +90,5 @@
                                    &iReturnedFormat, &ulReturnedItemCount, &ulDummy, &pcData) == Success)
             {
+                /** @todo r=bird: 6 QString conversions cannot be very efficient. */
                 if (QString((const char*)pcData).contains("Compiz", Qt::CaseInsensitive))
                     wmType = X11WMType_Compiz;
@@ -119,5 +124,5 @@
 {
     /* Init screen-save availability: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     int dummy;
     gX11ScreenSaverDpmsAvailable = DPMSQueryExtension(pDisplay, &dummy, &dummy);
@@ -135,5 +140,5 @@
      * save and restore the state prior and after each of these function calls. */
 
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     int dummy;
     CARD16 dummy2;
@@ -146,5 +151,5 @@
 {
     /* Restore screen-saver settings: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     int iTimeout, iInterval, iPreferBlank, iAllowExp;
     XGetScreenSaver(pDisplay, &iTimeout, &iInterval, &iPreferBlank, &iAllowExp);
@@ -159,5 +164,5 @@
 {
     /* Check extension: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     int major_opcode;
     int first_event;
@@ -394,5 +399,5 @@
 {
     bool fResult = true;
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
 
     if (fSwitchDesktop)
@@ -442,5 +447,5 @@
 
     /* Using a global to get at the display does not feel right, but that is how it is done elsewhere in the code. */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     Atom atomSupported            = XInternAtom(pDisplay, "_NET_SUPPORTED",
                                                 True /* only_if_exists */);
@@ -494,5 +499,5 @@
 bool NativeWindowSubsystem::X11SetFullScreenMonitor(QWidget *pWidget, ulong uScreenId)
 {
-    return XXSendClientMessage(QX11Info::display(),
+    return XXSendClientMessage(NativeWindowSubsystem::X11GetDisplay(),
                                pWidget->window()->winId(),
                                "_NET_WM_FULLSCREEN_MONITORS",
@@ -504,5 +509,5 @@
 {
     /* Get display: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
 
     /* Prepare atoms: */
@@ -548,5 +553,5 @@
 {
     /* Get display: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
 
     /* Prepare atoms: */
@@ -560,5 +565,5 @@
 {
     /* Get display: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
 
     /* Prepare atoms: */
@@ -582,5 +587,5 @@
 {
     /* Get display: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
 
     /* Prepare atoms: */
@@ -603,5 +608,5 @@
 {
     /* Get display: */
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
 
     /* Prepare atoms: */
@@ -642,10 +647,56 @@
     windowClass.res_class = classByteArray.data();
     /* Set WM_CLASS of the window to passed name and class strings: */
-    XSetClassHint(QX11Info::display(), pWidget->window()->winId(), &windowClass);
+    XSetClassHint(NativeWindowSubsystem::X11GetDisplay(), pWidget->window()->winId(), &windowClass);
 }
 
 void NativeWindowSubsystem::X11SetXwaylandMayGrabKeyboardFlag(QWidget *pWidget)
 {
-    XXSendClientMessage(QX11Info::display(), pWidget->window()->winId(),
+    XXSendClientMessage(NativeWindowSubsystem::X11GetDisplay(), pWidget->window()->winId(),
                         "_XWAYLAND_MAY_GRAB_KEYBOARD", 1);
 }
+
+Display *NativeWindowSubsystem::X11GetDisplay(void)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    Display *pDisplay = nullptr;
+    if (qApp)
+    {
+        QNativeInterface::QX11Application *pX11App = qApp->nativeInterface<QNativeInterface::QX11Application>();
+        if (pX11App)
+            pDisplay = pX11App->display();
+    }
+#else
+    Display *pDisplay = QX11Info::display();
+#endif
+    Assert(pDisplay);
+    return pDisplay;
+}
+
+xcb_connection_t *NativeWindowSubsystem::X11GetConnection(void)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    if (qApp)
+    {
+        QNativeInterface::QX11Application *pX11App = qApp->nativeInterface<QNativeInterface::QX11Application>();
+        if (pX11App)
+            return pX11App->connection();
+    }
+    return NULL;
+#else
+    return QX11Info::connection();
+#endif
+}
+
+uint32_t NativeWindowSubsystem::X11GetAppRootWindow(void)
+{
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    Window idWindow = 0;
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
+    if (pDisplay)
+        idWindow = DefaultRootWindow(pDisplay); /** @todo qt6: ?? */
+    return idWindow;
+#else
+    return QX11Info::appRootWindow();
+#endif
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/VBoxUtils-x11.h	(revision 94013)
@@ -76,4 +76,8 @@
 } xcb_size_hints_t;
 
+/* X11 structs to avoid dragging in unnecessary X headers: */
+struct xcb_connection_t;
+struct _XDisplay;
+
 /* Namespace for native window sub-system functions: */
 namespace NativeWindowSubsystem
@@ -124,4 +128,13 @@
       *      focus away from the VM. */
     SHARED_LIBRARY_STUFF void X11SetXwaylandMayGrabKeyboardFlag(QWidget *pWidget);
+
+    /** X11: Get the X11 display pointer. */
+    SHARED_LIBRARY_STUFF struct _XDisplay *X11GetDisplay(void);
+
+    /** X11: Get the X11 connection.   */
+    SHARED_LIBRARY_STUFF struct xcb_connection_t *X11GetConnection(void);
+
+    /** X11: Get the X11 root (desktop) window. */
+    SHARED_LIBRARY_STUFF uint32_t X11GetAppRootWindow(void);
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBuffer.cpp	(revision 94013)
@@ -36,4 +36,7 @@
 # include "UIMachineWindow.h"
 #endif /* VBOX_WITH_MASKED_SEAMLESS */
+#ifdef VBOX_WS_X11
+# include "VBoxUtils-x11.h"
+#endif
 
 /* COM includes: */
@@ -55,5 +58,4 @@
 #ifdef VBOX_WS_X11
 /* X11 includes: */
-# include <QX11Info>
 # include <X11/Xlib.h>
 # undef Bool // Qt5 vs Xlib gift..
@@ -1121,5 +1123,5 @@
 #ifdef VBOX_WS_X11
     /* Sync Qt and X11 Server (see xTracker #7547). */
-    XSync(QX11Info::display(), false);
+    XSync(NativeWindowSubsystem::X11GetDisplay(), false);
 #endif
 
@@ -1176,5 +1178,5 @@
 #ifdef VBOX_WS_X11
     /* Sync Qt and X11 Server (see xTracker #7547). */
-    XSync(QX11Info::display(), false);
+    XSync(NativeWindowSubsystem::X11GetDisplay(), false);
 #endif
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp	(revision 94013)
@@ -34,7 +34,4 @@
 #include <QKeyEvent>
 #include <QTimer>
-#ifdef VBOX_WS_X11
-# include <QX11Info>
-#endif
 
 /* GUI includes: */
@@ -64,4 +61,5 @@
 #ifdef VBOX_WS_X11
 # include "XKeyboard.h"
+# include "VBoxUtils-x11.h"
 #endif
 
@@ -275,6 +273,7 @@
          * version check some time in the future.  If we do, remove the comment above
          * about the focus notification dance, as it will no longer be relevant. */
-        xcb_get_input_focus_cookie_t xcbFocusCookie = xcb_get_input_focus(QX11Info::connection());
-        xcb_get_input_focus_reply_t *pFocusReply = xcb_get_input_focus_reply(QX11Info::connection(), xcbFocusCookie, 0);
+        xcb_get_input_focus_cookie_t xcbFocusCookie = xcb_get_input_focus(NativeWindowSubsystem::X11GetConnection());
+        xcb_get_input_focus_reply_t *pFocusReply = xcb_get_input_focus_reply(NativeWindowSubsystem::X11GetConnection(),
+                                                                             xcbFocusCookie, 0);
         xcb_window_t xcbFocusWindow = pFocusReply->focus;
         free(pFocusReply);
@@ -287,19 +286,21 @@
         /* If any previous grab is still in process, release it. */
         if (m_hButtonGrabWindow != 0)
-            xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
+            xcb_ungrab_button_checked(NativeWindowSubsystem::X11GetConnection(), XCB_BUTTON_INDEX_ANY,
                                       m_hButtonGrabWindow, XCB_MOD_MASK_ANY);
-        m_hButtonGrabWindow = QX11Info::appRootWindow();
-        xcb_grab_button_checked(QX11Info::connection(), 0, m_hButtonGrabWindow,
+        m_hButtonGrabWindow = NativeWindowSubsystem::X11GetAppRootWindow();
+        xcb_grab_button_checked(NativeWindowSubsystem::X11GetConnection(), 0, m_hButtonGrabWindow,
                                 XCB_EVENT_MASK_BUTTON_PRESS, XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC,
                                 XCB_NONE, XCB_NONE, XCB_BUTTON_INDEX_ANY, XCB_MOD_MASK_ANY);
         /* And grab the keyboard, using XCB directly, as Qt does not report failure. */
-        xcb_grab_keyboard_cookie_t xcbGrabCookie = xcb_grab_keyboard(QX11Info::connection(), false, m_views[m_iKeyboardCaptureViewIndex]->winId(),
+        xcb_grab_keyboard_cookie_t xcbGrabCookie = xcb_grab_keyboard(NativeWindowSubsystem::X11GetConnection(), false,
+                                                                     m_views[m_iKeyboardCaptureViewIndex]->winId(),
                                                                      XCB_TIME_CURRENT_TIME, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC);
-        xcb_grab_keyboard_reply_t *pGrabReply = xcb_grab_keyboard_reply(QX11Info::connection(), xcbGrabCookie, NULL);
+        xcb_grab_keyboard_reply_t *pGrabReply = xcb_grab_keyboard_reply(NativeWindowSubsystem::X11GetConnection(),
+                                                                        xcbGrabCookie, NULL);
         if (pGrabReply == NULL || pGrabReply->status != XCB_GRAB_STATUS_SUCCESS)
         {
             /* Release the mouse button grab.
              * We do not check for failure as we do not currently implement a back-up plan. */
-            xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
+            xcb_ungrab_button_checked(NativeWindowSubsystem::X11GetConnection(), XCB_BUTTON_INDEX_ANY,
                                       m_hButtonGrabWindow, XCB_MOD_MASK_ANY);
             m_hButtonGrabWindow = 0;
@@ -370,8 +371,8 @@
 
         /* Ungrab using XCB: */
-        xcb_ungrab_keyboard(QX11Info::connection(), XCB_TIME_CURRENT_TIME);
+        xcb_ungrab_keyboard(NativeWindowSubsystem::X11GetConnection(), XCB_TIME_CURRENT_TIME);
         /* Release the mouse button grab.
          * We do not check for failure as we do not currently implement a back-up plan. */
-        xcb_ungrab_button_checked(QX11Info::connection(), XCB_BUTTON_INDEX_ANY,
+        xcb_ungrab_button_checked(NativeWindowSubsystem::X11GetConnection(), XCB_BUTTON_INDEX_ANY,
                                   m_hButtonGrabWindow, XCB_MOD_MASK_ANY);
         m_hButtonGrabWindow = 0;
@@ -823,5 +824,5 @@
 
             /* Translate the keycode to a PC scan code: */
-            unsigned uScan = handleXKeyEvent(QX11Info::display(), pKeyEvent->detail);
+            unsigned uScan = handleXKeyEvent(NativeWindowSubsystem::X11GetDisplay(), pKeyEvent->detail);
 
             /* Scan codes 0x00 (no valid translation) and 0x80 (extended flag) are ignored: */
@@ -856,5 +857,5 @@
 
             /* Translate the keycode to a keysym: */
-            KeySym ks = ::wrapXkbKeycodeToKeysym(QX11Info::display(), pKeyEvent->detail, 0, 0);
+            KeySym ks = ::wrapXkbKeycodeToKeysym(NativeWindowSubsystem::X11GetDisplay(), pKeyEvent->detail, 0, 0);
 
             /* Update special flags: */
@@ -1020,10 +1021,10 @@
 #ifdef VBOX_WS_X11
     /* Initialize the X keyboard subsystem: */
-    initMappedX11Keyboard(QX11Info::display(), gEDataManager->remappedScanCodes());
+    initMappedX11Keyboard(NativeWindowSubsystem::X11GetDisplay(), gEDataManager->remappedScanCodes());
     /* Fix for http://www.virtualbox.org/ticket/1296:
      * when X11 sends events for repeated keys, it always inserts an XKeyRelease
      * before the XKeyPress. */
     /* Disable key release events during key auto-repeat: */
-    XkbSetDetectableAutoRepeat(QX11Info::display(), True, NULL);
+    XkbSetDetectableAutoRepeat(NativeWindowSubsystem::X11GetDisplay(), True, NULL);
 #endif /* VBOX_WS_X11 */
 
@@ -1774,5 +1775,5 @@
 
     Q_UNUSED(pHotKey);
-    Display *pDisplay = QX11Info::display();
+    Display *pDisplay = NativeWindowSubsystem::X11GetDisplay();
     KeyCode keyCode = XKeysymToKeycode(pDisplay, iHotKey);
     for (int i = 0; i < 4 && !fWasProcessed; ++i) /* Up to four groups. */
@@ -1852,13 +1853,14 @@
     unsigned uMask;
     unsigned uKeyMaskNum = 0, uKeyMaskCaps = 0;
+    Display * const pDisplay = NativeWindowSubsystem::X11GetDisplay();
 
     uKeyMaskCaps          = LockMask;
-    XModifierKeymap* map  = XGetModifierMapping(QX11Info::display());
-    KeyCode keyCodeNum    = XKeysymToKeycode(QX11Info::display(), XK_Num_Lock);
+    XModifierKeymap* map  = XGetModifierMapping(pDisplay);
+    KeyCode keyCodeNum    = XKeysymToKeycode(pDisplay, XK_Num_Lock);
 
     for (int i = 0; i < 8; ++ i)
         if (keyCodeNum != NoSymbol && map->modifiermap[map->max_keypermod * i] == keyCodeNum)
             uKeyMaskNum = 1 << i;
-    XQueryPointer(QX11Info::display(), DefaultRootWindow(QX11Info::display()), &wDummy1, &wDummy2,
+    XQueryPointer(pDisplay, DefaultRootWindow(pDisplay), &wDummy1, &wDummy2,
                   &iDummy3, &iDummy4, &iDummy5, &iDummy6, &uMask);
     XFreeModifiermap(map);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp	(revision 94013)
@@ -28,7 +28,4 @@
 # include <QMenuBar>
 #endif /* VBOX_WS_MAC */
-#ifdef VBOX_WS_X11
-# include <QX11Info>
-#endif /* VBOX_WS_X11 */
 
 /* GUI includes: */
@@ -72,4 +69,7 @@
 # include "UINetworkRequestManager.h"
 #endif
+#ifdef VBOX_WS_X11
+# include "VBoxUtils-x11.h"
+#endif
 
 /* COM includes: */
@@ -565,5 +565,5 @@
             /* The keyboard handler may wish to do some release logging on startup.
              * Tell it that the logger is now active. */
-            doXKeyboardLogging(QX11Info::display());
+            doXKeyboardLogging(NativeWindowSubsystem::X11GetDisplay());
             break;
         }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp	(revision 94013)
@@ -20,7 +20,4 @@
 #include <QTimer>
 #include <QTouchEvent>
-#ifdef VBOX_WS_X11
-# include <QX11Info>
-#endif
 
 /* GUI includes: */
@@ -44,4 +41,7 @@
 # include "VBoxUtils-win.h"
 #endif
+#ifdef VBOX_WS_X11
+# include "VBoxUtils-x11.h"
+#endif
 
 /* COM includes: */
@@ -51,9 +51,4 @@
 /* Other VBox includes: */
 #include <iprt/time.h>
-
-/* External includes: */
-#ifdef VBOX_WS_X11
-#include "VBoxUtils-x11.h"
-#endif
 
 
@@ -341,5 +336,5 @@
                 machineLogic()->keyboardHandler()->captureKeyboard(uScreenId);
                 /* Re-send the event so that the window which it was meant for gets it: */
-                xcb_allow_events_checked(QX11Info::connection(), XCB_ALLOW_REPLAY_POINTER, pButtonEvent->time);
+                xcb_allow_events_checked(NativeWindowSubsystem::X11GetConnection(), XCB_ALLOW_REPLAY_POINTER, pButtonEvent->time);
                 /* Do not let Qt see the event: */
                 return true;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 94013)
@@ -27,7 +27,4 @@
 # include <iprt/win/windows.h> /* Workaround for compile errors if included directly by QtWin. */
 # include <QtWin>
-#endif
-#ifdef VBOX_WS_X11
-# include <QX11Info>
 #endif
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIHostComboEditor.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIHostComboEditor.cpp	(revision 94012)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIHostComboEditor.cpp	(revision 94013)
@@ -23,7 +23,4 @@
 #include <QStylePainter>
 #include <QTimer>
-#ifdef VBOX_WS_X11
-# include <QX11Info>
-#endif
 #if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
 # include <QAbstractNativeEventFilter>
@@ -44,4 +41,5 @@
 #elif defined(VBOX_WS_X11)
 # include "XKeyboard.h"
+# include "VBoxUtils-x11.h"
 #endif
 
@@ -561,5 +559,5 @@
 #elif defined(VBOX_WS_X11)
     /* Initialize the X keyboard subsystem: */
-    initMappedX11Keyboard(QX11Info::display(), gEDataManager->remappedScanCodes());
+    initMappedX11Keyboard(NativeWindowSubsystem::X11GetDisplay(), gEDataManager->remappedScanCodes());
 #endif /* VBOX_WS_X11 */
 }
@@ -748,5 +746,5 @@
             xcb_key_press_event_t *pKeyEvent = static_cast<xcb_key_press_event_t*>(pMessage);
             RT_GCC_NO_WARN_DEPRECATED_BEGIN
-            const KeySym ks = ::XKeycodeToKeysym(QX11Info::display(), pKeyEvent->detail, 0);
+            const KeySym ks = ::XKeycodeToKeysym(NativeWindowSubsystem::X11GetDisplay(), pKeyEvent->detail, 0);
             RT_GCC_NO_WARN_DEPRECATED_END
             const int iKeySym = static_cast<int>(ks);
