Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 59343)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp	(revision 59344)
@@ -97,7 +97,5 @@
 #endif /* Q_WS_MAC */
 #ifdef Q_WS_X11
-# if QT_VERSION >= 0x050000
-#  include <xcb/xcb.h>
-# else /* QT_VERSION < 0x050000 */
+# if QT_VERSION < 0x050000
 #  include <X11/XKBlib.h>
 #  ifdef KeyPress
@@ -111,5 +109,7 @@
 #   undef FocusIn
 #  endif /* KeyPress */
-# endif /* QT_VERSION < 0x050000 */
+# else /* QT_VERSION >= 0x050000 */
+#  include <xcb/xcb.h>
+# endif /* QT_VERSION >= 0x050000 */
 #endif /* Q_WS_X11 */
 
@@ -122,48 +122,4 @@
 #endif
 
-
-#ifdef Q_WS_X11
-# if QT_VERSION >= 0x050000
-/*********************************************************************************************************************************
-*   Class UIViewport implementation.                                                                                             *
-*********************************************************************************************************************************/
-
-UIViewport::UIViewport(UIMachineView *pParent)
-    : QWidget(pParent)
-    , m_pMachineView(pParent)
-{
-}
-
-bool UIViewport::nativeEvent(const QByteArray &eventType, void *pMessage, long *pResult)
-{
-    /* Make sure it's XCB event: */
-    AssertReturn(eventType == "xcb_generic_event_t", QWidget::nativeEvent(eventType, pMessage, pResult));
-    xcb_generic_event_t *pEvent = static_cast<xcb_generic_event_t*>(pMessage);
-
-    /* Check if some XCB event should be filtered out.
-     * Returning @c true means filtering-out,
-     * Returning @c false means passing event to Qt. */
-    switch (pEvent->response_type & ~0x80)
-    {
-        /* Watch for key-events: */
-        case XCB_KEY_PRESS:
-        case XCB_KEY_RELEASE:
-        {
-            /* Delegate key-event handling to the keyboard-handler: */
-            return machineView()->machineLogic()->keyboardHandler()->nativeEventFilter(pMessage, machineView()->screenId());
-        }
-        default:
-            break;
-    }
-
-    /* Call to base-class: */
-    return QWidget::nativeEvent(eventType, pMessage, pResult);
-}
-# endif /* QT_VERSION >= 0x050000 */
-#endif /* Q_WS_X11 */
-
-/*********************************************************************************************************************************
-*   Class UIMachineView implementation.                                                                                          *
-*********************************************************************************************************************************/
 
 /* static */
@@ -668,9 +624,4 @@
 {
     /* Prepare viewport: */
-#ifdef Q_WS_X11
-# if QT_VERSION >= 0x050000
-    setViewport(new UIViewport(this));
-# endif /* QT_VERSION >= 0x050000 */
-#endif /* Q_WS_X11 */
     AssertPtrReturnVoid(viewport());
     {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 59343)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h	(revision 59344)
@@ -58,7 +58,5 @@
 class CSession;
 #ifdef Q_WS_X11
-# if QT_VERSION >= 0x050000
-class UIMachineView;
-# else /* QT_VERSION < 0x050000 */
+# if QT_VERSION < 0x050000
 typedef union _XEvent XEvent;
 # endif /* QT_VERSION < 0x050000 */
@@ -68,39 +66,4 @@
 #endif /* VBOX_WITH_DRAG_AND_DROP */
 
-
-#ifdef Q_WS_X11
-# if QT_VERSION >= 0x050000
-/** X11: Qt5: QWidget extension used as UIMachineView's viewport.
-  * This class is currently required because of Qt5 policy change about
-  * native keyboard events now being delivered directly to a focus-holder
-  * (UIMachineView's viewport) instead of delivering it to top-most widget
-  * (UIMachineWindow) and then propagating down to the focus-holder, which
-  * with Qt4 allowed us to handle such events in focus-holder's focus-proxy
-  * (UIMachineView) instead of focus-holder itself. */
-class UIViewport : public QWidget
-{
-    Q_OBJECT;
-
-public:
-
-    /** Constructor which brings the @a pParent machine-view. */
-    UIViewport(UIMachineView *pParent);
-
-    /** Returns the reference to the parent machine-view. */
-    const UIMachineView* machineView() { return m_pMachineView; }
-
-protected:
-
-    /** Qt5: Handles any native @a pMessage of the predefined @a eventType,
-      * allowing to set the @a pResult to be returned to the issuer. */
-    virtual bool nativeEvent(const QByteArray &eventType, void *pMessage, long *pResult);
-
-private:
-
-    /** Holds the reference to the parent machine-view. */
-    const UIMachineView *m_pMachineView;
-};
-# endif /* QT_VERSION >= 0x050000 */
-#endif /* Q_WS_X11 */
 
 class UIMachineView : public QAbstractScrollArea
@@ -453,9 +416,4 @@
     friend class UIFrameBufferPrivate;
     friend class VBoxOverlayFrameBuffer;
-#ifdef Q_WS_X11
-# if QT_VERSION >= 0x050000
-    friend class UIViewport;
-# endif /* QT_VERSION >= 0x050000 */
-#endif /* Q_WS_X11 */
 };
 
