Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 81256)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 81257)
@@ -785,5 +785,4 @@
 	src/extensions/QILineEdit.h \
 	src/extensions/QIMainDialog.h \
-	src/extensions/QIMainWindow.h \
 	src/extensions/QIManagerDialog.h \
 	src/extensions/QIMenu.h \
@@ -1267,5 +1266,4 @@
 	src/extensions/QILineEdit.cpp \
 	src/extensions/QIMainDialog.cpp \
-	src/extensions/QIMainWindow.cpp \
 	src/extensions/QIManagerDialog.cpp \
 	src/extensions/QIMenu.cpp \
Index: unk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.cpp	(revision 81256)
+++ 	(revision )
@@ -1,114 +1,0 @@
-/* $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: unk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainWindow.h	(revision 81256)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/* $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 81256)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp	(revision 81257)
@@ -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 @@
 
 
-/** QIMainWindow extension
+/** QMainWindow extension
   * providing Extra Data Manager with UI features. */
-class UIExtraDataManagerWindow : public QIMainWindow
+class UIExtraDataManagerWindow : public QIWithRestorableGeometry<QMainWindow>
 {
     Q_OBJECT;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/QIWithRestorableGeometry.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/QIWithRestorableGeometry.h	(revision 81257)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/QIWithRestorableGeometry.h	(revision 81257)
@@ -0,0 +1,140 @@
+/* $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 81256)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 81257)
@@ -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 QIWithRetranslateUI<QIMainWindow>::eventFilter(pObject, pEvent);
+        return QMainWindowWithRestorableGeometryAndRetranslateUi::eventFilter(pObject, pEvent);
 
     /* Ignore for other objects: */
     if (qobject_cast<QWidget*>(pObject) &&
         qobject_cast<QWidget*>(pObject)->window() != this)
-        return QIWithRetranslateUI<QIMainWindow>::eventFilter(pObject, pEvent);
+        return QMainWindowWithRestorableGeometryAndRetranslateUi::eventFilter(pObject, pEvent);
 
     /* Which event do we have? */
@@ -150,5 +150,5 @@
 
     /* Call to base-class: */
-    return QIWithRetranslateUI<QIMainWindow>::eventFilter(pObject, pEvent);
+    return QMainWindowWithRestorableGeometryAndRetranslateUi::eventFilter(pObject, pEvent);
 }
 #endif /* VBOX_WS_MAC */
@@ -184,5 +184,5 @@
     }
     /* Call to base-class: */
-    return QIWithRetranslateUI<QIMainWindow>::event(pEvent);
+    return QMainWindowWithRestorableGeometryAndRetranslateUi::event(pEvent);
 }
 
@@ -190,5 +190,5 @@
 {
     /* Call to base-class: */
-    QIWithRetranslateUI<QIMainWindow>::showEvent(pEvent);
+    QMainWindowWithRestorableGeometryAndRetranslateUi::showEvent(pEvent);
 
     /* Is polishing required? */
@@ -211,5 +211,5 @@
 {
     /* Call to base-class: */
-    QIWithRetranslateUI<QIMainWindow>::closeEvent(pEvent);
+    QMainWindowWithRestorableGeometryAndRetranslateUi::closeEvent(pEvent);
 
     /* Quit application: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h	(revision 81256)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h	(revision 81257)
@@ -23,8 +23,9 @@
 
 /* Qt includes: */
+#include <QMainWindow>
 #include <QUrl>
 
 /* GUI includes: */
-#include "QIMainWindow.h"
+#include "QIWithRestorableGeometry.h"
 #include "QIWithRetranslateUI.h"
 #include "UICommon.h"
@@ -39,8 +40,10 @@
 
 /* Type definitions: */
+typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
+typedef QIWithRetranslateUI<QMainWindowWithRestorableGeometry> QMainWindowWithRestorableGeometryAndRetranslateUi;
 typedef QMap<QString, QIManagerDialog*> VMLogViewerMap;
 
-/** Singleton QIMainWindow extension used as VirtualBox Manager instance. */
-class UIVirtualBoxManager : public QIWithRetranslateUI<QIMainWindow>
+/** Singleton QMainWindow extension used as VirtualBox Manager instance. */
+class UIVirtualBoxManager : public QMainWindowWithRestorableGeometryAndRetranslateUi
 {
     Q_OBJECT;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp	(revision 81256)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp	(revision 81257)
@@ -79,5 +79,5 @@
 
 UIVMInformationDialog::UIVMInformationDialog(UIMachineWindow *pMachineWindow)
-    : QIWithRetranslateUI<QIMainWindow>(0)
+    : QMainWindowWithRestorableGeometryAndRetranslateUi(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 81256)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.h	(revision 81257)
@@ -22,6 +22,9 @@
 #endif
 
+/* Qt includes: */
+#include <QMainWindow>
+
 /* GUI includes: */
-#include "QIMainWindow.h"
+#include "QIWithRestorableGeometry.h"
 #include "QIWithRetranslateUI.h"
 
@@ -35,8 +38,12 @@
 class UIMachineWindow;
 
+/* Type definitions: */
+typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
+typedef QIWithRetranslateUI<QMainWindowWithRestorableGeometry> QMainWindowWithRestorableGeometryAndRetranslateUi;
 
-/** QIMainWindow subclass providing user
+
+/** QMainWindow subclass providing user
   * with the dialog unifying VM details and statistics. */
-class UIVMInformationDialog : public QIWithRetranslateUI<QIMainWindow>
+class UIVMInformationDialog : public QMainWindowWithRestorableGeometryAndRetranslateUi
 {
     Q_OBJECT;
