Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 81257)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 81258)
@@ -785,4 +785,5 @@
 	src/extensions/QILineEdit.h \
 	src/extensions/QIMainDialog.h \
+	src/extensions/QIMainWindow.h \
 	src/extensions/QIManagerDialog.h \
 	src/extensions/QIMenu.h \
@@ -1266,4 +1267,5 @@
 	src/extensions/QILineEdit.cpp \
 	src/extensions/QIMainDialog.cpp \
+	src/extensions/QIMainWindow.cpp \
 	src/extensions/QIManagerDialog.cpp \
 	src/extensions/QIMenu.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.cpp	(revision 81258)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.cpp	(revision 81258)
@@ -0,0 +1,114 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - QIMainWindow class implementation.
+ */
+
+/*
+ * Copyright (C) 2016-2019 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Qt includes: */
+#include <QResizeEvent>
+
+/* GUI includes: */
+#include "QIMainWindow.h"
+#ifdef VBOX_WS_MAC
+# include "VBoxUtils-darwin.h"
+#endif
+#ifdef VBOX_WS_X11
+# include "UICommon.h"
+# include "UIDesktopWidgetWatchdog.h"
+#endif
+
+/* Other VBox includes: */
+#ifdef VBOX_WS_MAC
+# include "iprt/cpp/utils.h"
+#endif
+
+
+QIMainWindow::QIMainWindow(QWidget *pParent /* = 0 */, Qt::WindowFlags enmFlags /* = 0 */)
+    : QMainWindow(pParent, enmFlags)
+{
+}
+
+void QIMainWindow::moveEvent(QMoveEvent *pEvent)
+{
+    /* Call to base-class: */
+    QMainWindow::moveEvent(pEvent);
+
+#ifdef VBOX_WS_X11
+    /* Prevent further handling if fake screen detected: */
+    if (gpDesktop->isFakeScreenDetected())
+        return;
+#endif
+
+    /* Prevent handling for yet/already invisible window or if window is in minimized state: */
+    if (isVisible() && (windowState() & Qt::WindowMinimized) == 0)
+    {
+#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
+        /* Use the old approach for OSX/Win: */
+        m_geometry.moveTo(frameGeometry().x(), frameGeometry().y());
+#else
+        /* Use the new approach otherwise: */
+        m_geometry.moveTo(geometry().x(), geometry().y());
+#endif
+    }
+}
+
+void QIMainWindow::resizeEvent(QResizeEvent *pEvent)
+{
+    /* Call to base-class: */
+    QMainWindow::resizeEvent(pEvent);
+
+#ifdef VBOX_WS_X11
+    /* Prevent handling if fake screen detected: */
+    if (gpDesktop->isFakeScreenDetected())
+        return;
+#endif
+
+    /* Prevent handling for yet/already invisible window or if window is in minimized state: */
+    if (isVisible() && (windowState() & Qt::WindowMinimized) == 0)
+    {
+        QResizeEvent *pResizeEvent = static_cast<QResizeEvent*>(pEvent);
+        m_geometry.setSize(pResizeEvent->size());
+    }
+}
+
+void QIMainWindow::restoreGeometry(const QRect &rect)
+{
+    m_geometry = rect;
+#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
+    /* Use the old approach for OSX/Win: */
+    move(m_geometry.topLeft());
+    resize(m_geometry.size());
+#else
+    /* Use the new approach otherwise: */
+    UICommon::setTopLevelGeometry(this, m_geometry);
+#endif
+
+    /* Maximize (if necessary): */
+    if (shouldBeMaximized())
+        showMaximized();
+}
+
+QRect QIMainWindow::currentGeometry() const
+{
+    return m_geometry;
+}
+
+bool QIMainWindow::isCurrentlyMaximized() const
+{
+#ifdef VBOX_WS_MAC
+    return ::darwinIsWindowMaximized(unconst(this));
+#else
+    return isMaximized();
+#endif
+}
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.h	(revision 81258)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.h	(revision 81258)
@@ -0,0 +1,69 @@
+/* $Id$ */
+/** @file
+ * VBox Qt GUI - QIMainWindow class declaration.
+ */
+
+/*
+ * Copyright (C) 2016-2019 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef FEQT_INCLUDED_SRC_extensions_QIMainWindow_h
+#define FEQT_INCLUDED_SRC_extensions_QIMainWindow_h
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+/* Qt includes: */
+#include <QMainWindow>
+#include <QRect>
+
+/* GUI includes: */
+#include "UILibraryDefs.h"
+
+/* Forward declarations: */
+class QWidget;
+
+/** QMainWindow extension providing GUI
+  * with the extended geometry management support. */
+class SHARED_LIBRARY_STUFF QIMainWindow : public QMainWindow
+{
+    Q_OBJECT;
+
+public:
+
+    /** Constructs main window passing @a pParent and @a enmFlags to base-class. */
+    QIMainWindow(QWidget *pParent = 0, Qt::WindowFlags enmFlags = 0);
+
+protected:
+
+    /** Handles move @a pEvent. */
+    virtual void moveEvent(QMoveEvent *pEvent) /* override */;
+    /** Handles resize @a pEvent. */
+    virtual void resizeEvent(QResizeEvent *pEvent) /* override */;
+
+    /** Returns whether the window should be maximized when geometry being restored. */
+    virtual bool shouldBeMaximized() const { return false; }
+
+    /** Restores the window geometry to passed @a rect. */
+    void restoreGeometry(const QRect &rect);
+
+    /** Returns current window geometry. */
+    QRect currentGeometry() const;
+    /** Returns whether the window is currently maximized. */
+    bool isCurrentlyMaximized() const;
+
+private:
+
+    /** Holds the cached window geometry. */
+    QRect m_geometry;
+};
+
+#endif /* !FEQT_INCLUDED_SRC_extensions_QIMainWindow_h */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 81257)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 81258)
@@ -53,7 +53,7 @@
 # include "QIDialogButtonBox.h"
 # include "QIFileDialog.h"
+# include "QIMainWindow.h"
 # include "QISplitter.h"
 # include "QIWidgetValidator.h"
-# include "QIWithRestorableGeometry.h"
 # include "VBoxUtils.h"
 # include "UIIconPool.h"
@@ -458,7 +458,7 @@
 
 
-/** QMainWindow extension
+/** QIMainWindow extension
   * providing Extra Data Manager with UI features. */
-class UIExtraDataManagerWindow : public QIWithRestorableGeometry<QMainWindow>
+class UIExtraDataManagerWindow : public QIMainWindow
 {
     Q_OBJECT;
Index: unk/src/VBox/Frontends/VirtualBox/src/globals/QIWithRestorableGeometry.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/QIWithRestorableGeometry.h	(revision 81257)
+++ 	(revision )
@@ -1,140 +1,0 @@
-/* $Id$ */
-/** @file
- * VBox Qt GUI - QIWithRestorableGeometry class declaration.
- */
-
-/*
- * Copyright (C) 2016-2019 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef FEQT_INCLUDED_SRC_globals_QIWithRestorableGeometry_h
-#define FEQT_INCLUDED_SRC_globals_QIWithRestorableGeometry_h
-#ifndef RT_WITHOUT_PRAGMA_ONCE
-# pragma once
-#endif
-
-/* Qt includes: */
-#include <QMainWindow>
-#include <QRect>
-#include <QResizeEvent>
-
-/* GUI includes: */
-#include "UILibraryDefs.h"
-#ifdef VBOX_WS_MAC
-# include "VBoxUtils-darwin.h"
-#endif
-#ifdef VBOX_WS_X11
-# include "UICommon.h"
-# include "UIDesktopWidgetWatchdog.h"
-#endif
-
-/** Template with geometry saving/restoring capabilities. */
-template <class Base>
-class QIWithRestorableGeometry : public Base
-{
-public:
-
-    /** Constructs main window passing @a pParent and @a enmFlags to base-class. */
-    QIWithRestorableGeometry(QWidget *pParent = 0, Qt::WindowFlags enmFlags = 0)
-        : Base(pParent, enmFlags)
-    {}
-
-protected:
-
-    /** Handles move @a pEvent. */
-    virtual void moveEvent(QMoveEvent *pEvent) /* override */
-    {
-        /* Call to base-class: */
-        QMainWindow::moveEvent(pEvent);
-
-#ifdef VBOX_WS_X11
-        /* Prevent further handling if fake screen detected: */
-        if (gpDesktop->isFakeScreenDetected())
-            return;
-#endif
-
-        /* Prevent handling for yet/already invisible window or if window is in minimized state: */
-        if (isVisible() && (windowState() & Qt::WindowMinimized) == 0)
-        {
-#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
-            /* Use the old approach for OSX/Win: */
-            m_geometry.moveTo(frameGeometry().x(), frameGeometry().y());
-#else
-            /* Use the new approach otherwise: */
-            m_geometry.moveTo(geometry().x(), geometry().y());
-#endif
-        }
-    }
-
-    /** Handles resize @a pEvent. */
-    virtual void resizeEvent(QResizeEvent *pEvent) /* override */
-    {
-        /* Call to base-class: */
-        QMainWindow::resizeEvent(pEvent);
-
-#ifdef VBOX_WS_X11
-        /* Prevent handling if fake screen detected: */
-        if (gpDesktop->isFakeScreenDetected())
-            return;
-#endif
-
-        /* Prevent handling for yet/already invisible window or if window is in minimized state: */
-        if (isVisible() && (windowState() & Qt::WindowMinimized) == 0)
-        {
-            QResizeEvent *pResizeEvent = static_cast<QResizeEvent*>(pEvent);
-            m_geometry.setSize(pResizeEvent->size());
-        }
-    }
-
-    /** Returns whether the window should be maximized when geometry being restored. */
-    virtual bool shouldBeMaximized() const { return false; }
-
-    /** Restores the window geometry to passed @a rect. */
-    void restoreGeometry(const QRect &rect)
-    {
-        m_geometry = rect;
-#if defined(VBOX_WS_MAC) || defined(VBOX_WS_WIN)
-        /* Use the old approach for OSX/Win: */
-        move(m_geometry.topLeft());
-        resize(m_geometry.size());
-#else
-        /* Use the new approach otherwise: */
-        UICommon::setTopLevelGeometry(this, m_geometry);
-#endif
-
-        /* Maximize (if necessary): */
-        if (shouldBeMaximized())
-            showMaximized();
-    }
-
-    /** Returns current window geometry. */
-    QRect currentGeometry() const
-    {
-        return m_geometry;
-    }
-
-    /** Returns whether the window is currently maximized. */
-    bool isCurrentlyMaximized() const
-    {
-#ifdef VBOX_WS_MAC
-        return ::darwinIsWindowMaximized(this);
-#else
-        return isMaximized();
-#endif
-    }
-
-private:
-
-    /** Holds the cached window geometry. */
-    QRect m_geometry;
-};
-
-#endif /* !FEQT_INCLUDED_SRC_globals_QIWithRestorableGeometry_h */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 81257)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 81258)
@@ -128,10 +128,10 @@
     /* Ignore for non-active window except for FileOpen event which should be always processed: */
     if (!isActiveWindow() && pEvent->type() != QEvent::FileOpen)
-        return QMainWindowWithRestorableGeometryAndRetranslateUi::eventFilter(pObject, pEvent);
+        return QIWithRetranslateUI<QIMainWindow>::eventFilter(pObject, pEvent);
 
     /* Ignore for other objects: */
     if (qobject_cast<QWidget*>(pObject) &&
         qobject_cast<QWidget*>(pObject)->window() != this)
-        return QMainWindowWithRestorableGeometryAndRetranslateUi::eventFilter(pObject, pEvent);
+        return QIWithRetranslateUI<QIMainWindow>::eventFilter(pObject, pEvent);
 
     /* Which event do we have? */
@@ -150,5 +150,5 @@
 
     /* Call to base-class: */
-    return QMainWindowWithRestorableGeometryAndRetranslateUi::eventFilter(pObject, pEvent);
+    return QIWithRetranslateUI<QIMainWindow>::eventFilter(pObject, pEvent);
 }
 #endif /* VBOX_WS_MAC */
@@ -184,5 +184,5 @@
     }
     /* Call to base-class: */
-    return QMainWindowWithRestorableGeometryAndRetranslateUi::event(pEvent);
+    return QIWithRetranslateUI<QIMainWindow>::event(pEvent);
 }
 
@@ -190,5 +190,5 @@
 {
     /* Call to base-class: */
-    QMainWindowWithRestorableGeometryAndRetranslateUi::showEvent(pEvent);
+    QIWithRetranslateUI<QIMainWindow>::showEvent(pEvent);
 
     /* Is polishing required? */
@@ -211,5 +211,5 @@
 {
     /* Call to base-class: */
-    QMainWindowWithRestorableGeometryAndRetranslateUi::closeEvent(pEvent);
+    QIWithRetranslateUI<QIMainWindow>::closeEvent(pEvent);
 
     /* Quit application: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h	(revision 81257)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h	(revision 81258)
@@ -23,9 +23,8 @@
 
 /* Qt includes: */
-#include <QMainWindow>
 #include <QUrl>
 
 /* GUI includes: */
-#include "QIWithRestorableGeometry.h"
+#include "QIMainWindow.h"
 #include "QIWithRetranslateUI.h"
 #include "UICommon.h"
@@ -40,10 +39,8 @@
 
 /* Type definitions: */
-typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
-typedef QIWithRetranslateUI<QMainWindowWithRestorableGeometry> QMainWindowWithRestorableGeometryAndRetranslateUi;
 typedef QMap<QString, QIManagerDialog*> VMLogViewerMap;
 
-/** Singleton QMainWindow extension used as VirtualBox Manager instance. */
-class UIVirtualBoxManager : public QMainWindowWithRestorableGeometryAndRetranslateUi
+/** Singleton QIMainWindow extension used as VirtualBox Manager instance. */
+class UIVirtualBoxManager : public QIWithRetranslateUI<QIMainWindow>
 {
     Q_OBJECT;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp	(revision 81257)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp	(revision 81258)
@@ -79,5 +79,5 @@
 
 UIVMInformationDialog::UIVMInformationDialog(UIMachineWindow *pMachineWindow)
-    : QMainWindowWithRestorableGeometryAndRetranslateUi(0)
+    : QIWithRetranslateUI<QIMainWindow>(0)
     , m_pTabWidget(0)
     , m_pMachineWindow(pMachineWindow)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h	(revision 81257)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h	(revision 81258)
@@ -22,9 +22,6 @@
 #endif
 
-/* Qt includes: */
-#include <QMainWindow>
-
 /* GUI includes: */
-#include "QIWithRestorableGeometry.h"
+#include "QIMainWindow.h"
 #include "QIWithRetranslateUI.h"
 
@@ -38,12 +35,8 @@
 class UIMachineWindow;
 
-/* Type definitions: */
-typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
-typedef QIWithRetranslateUI<QMainWindowWithRestorableGeometry> QMainWindowWithRestorableGeometryAndRetranslateUi;
 
-
-/** QMainWindow subclass providing user
+/** QIMainWindow subclass providing user
   * with the dialog unifying VM details and statistics. */
-class UIVMInformationDialog : public QMainWindowWithRestorableGeometryAndRetranslateUi
+class UIVMInformationDialog : public QIWithRetranslateUI<QIMainWindow>
 {
     Q_OBJECT;
