linuxfb: generate expose events

Task-number: QTBUG-57747
Change-Id: I7e6a26b447cb929842e69e85fb91882c04ae10d0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2016-12-22 11:18:15 +01:00 committed by Andy Nichols
parent 7980e92e89
commit 94b136f320

View File

@ -69,10 +69,14 @@ void QFbWindow::setGeometry(const QRect &rect)
QWindowSystemInterface::handleGeometryChange(window(), rect);
QPlatformWindow::setGeometry(rect);
if (mOldGeometry != rect)
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
}
void QFbWindow::setVisible(bool visible)
{
QRect newGeom;
QFbScreen *fbScreen = platformScreen();
if (visible) {
bool convOk = false;
@ -80,9 +84,9 @@ void QFbWindow::setVisible(bool visible)
const bool platformDisableForceFullScreen = fbScreen->flags().testFlag(QFbScreen::DontForceFirstWindowToFullScreen);
const bool forceFullScreen = !envDisableForceFullScreen && !platformDisableForceFullScreen && fbScreen->windowCount() == 0;
if (forceFullScreen || (mWindowState & Qt::WindowFullScreen))
setGeometry(platformScreen()->geometry());
newGeom = platformScreen()->geometry();
else if (mWindowState & Qt::WindowMaximized)
setGeometry(platformScreen()->availableGeometry());
newGeom = platformScreen()->availableGeometry();
}
QPlatformWindow::setVisible(visible);
@ -90,8 +94,17 @@ void QFbWindow::setVisible(bool visible)
fbScreen->addWindow(this);
else
fbScreen->removeWindow(this);
}
if (!newGeom.isEmpty())
setGeometry(newGeom); // may or may not generate an expose
if (newGeom.isEmpty() || newGeom == mOldGeometry) {
// QWindow::isExposed() maps to QWindow::visible() by default so simply
// generating an expose event regardless of this being a show or hide is
// just what is needed here.
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
}
}
void QFbWindow::setWindowState(Qt::WindowState state)
{
@ -112,11 +125,13 @@ Qt::WindowFlags QFbWindow::windowFlags() const
void QFbWindow::raise()
{
platformScreen()->raise(this);
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
}
void QFbWindow::lower()
{
platformScreen()->lower(this);
QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
}
void QFbWindow::repaint(const QRegion &region)