7#include <QtGui/QScreen>
8#include <qpa/qwindowsysteminterface.h>
12Q_CONSTINIT
static QBasicAtomicInt winIdGenerator = Q_BASIC_ATOMIC_INITIALIZER(0);
15 : QPlatformWindow(window),
mBackingStore(0), mWindowState(Qt::WindowNoState)
17 mWindowId = winIdGenerator.fetchAndAddRelaxed(1) + 1;
26 return static_cast<
QFbScreen *>(window()->screen()->handle());
32 mOldGeometry = geometry();
34 QWindowSystemInterface::handleGeometryChange(window(), rect);
36 QPlatformWindow::setGeometry(rect);
38 if (mOldGeometry != rect)
39 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
48 static bool envDisableForceFullScreen = qEnvironmentVariableIntValue(
"QT_QPA_FB_FORCE_FULLSCREEN", &convOk) == 0 && convOk;
49 const bool platformDisableForceFullScreen = fbScreen->flags().testFlag(QFbScreen::DontForceFirstWindowToFullScreen);
50 const bool forceFullScreen = !envDisableForceFullScreen && !platformDisableForceFullScreen && fbScreen
->windowCount() == 0;
51 if (forceFullScreen || (mWindowState & Qt::WindowFullScreen))
53 else if (mWindowState & Qt::WindowMaximized)
56 QPlatformWindow::setVisible(visible);
63 if (!newGeom.isEmpty())
66 if (newGeom.isEmpty() || newGeom == mOldGeometry) {
70 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
76 QPlatformWindow::setWindowState(state);
93 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
99 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size()));
104 const QRect currentGeometry = geometry();
105 const QRect oldGeometryLocal = mOldGeometry;
106 mOldGeometry = currentGeometry;
108 if (oldGeometryLocal != currentGeometry)
110 auto topLeft = currentGeometry.topLeft();
111 for (
auto rect : region)
112 platformScreen()->setDirty(rect.translated(topLeft));
virtual int windowCount() const
virtual void lower(QFbWindow *window)
virtual void raise(QFbWindow *window)
virtual void removeWindow(QFbWindow *window)
virtual void addWindow(QFbWindow *window)
Qt::WindowFlags windowFlags() const
QFbScreen * platformScreen() const
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
virtual void repaint(const QRegion &)
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QFbBackingStore * mBackingStore
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
void setWindowFlags(Qt::WindowFlags type) override
Requests setting the window flags of this surface to flags.
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.