add/remove window only when the window is shown/hidden

Task-number: QTBUG-34469

Change-Id: Id77cf738f96bb94582833f6734a2a491b01e1666
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
This commit is contained in:
BogDan Vatra 2013-11-06 17:17:49 +02:00 committed by The Qt Project
parent 6ff08b7db3
commit b953e2f53f

View File

@ -52,13 +52,10 @@ QFbWindow::QFbWindow(QWindow *window)
{
static QAtomicInt winIdGenerator(1);
mWindowId = winIdGenerator.fetchAndAddRelaxed(1);
platformScreen()->addWindow(this);
}
QFbWindow::~QFbWindow()
{
platformScreen()->removeWindow(this);
}
QFbScreen *QFbWindow::platformScreen() const
@ -86,6 +83,11 @@ void QFbWindow::setVisible(bool visible)
setGeometry(platformScreen()->availableGeometry());
}
QPlatformWindow::setVisible(visible);
if (visible)
platformScreen()->addWindow(this);
else
platformScreen()->removeWindow(this);
}