diff options
Diffstat (limited to 'qt5-layer/recipes-qt/examples')
-rw-r--r-- | qt5-layer/recipes-qt/examples/cinematicexperience/fix-fullscreen-mode.patch | 43 | ||||
-rw-r--r-- | qt5-layer/recipes-qt/examples/cinematicexperience_1.0.bbappend | 3 |
2 files changed, 46 insertions, 0 deletions
diff --git a/qt5-layer/recipes-qt/examples/cinematicexperience/fix-fullscreen-mode.patch b/qt5-layer/recipes-qt/examples/cinematicexperience/fix-fullscreen-mode.patch new file mode 100644 index 0000000..a7a6846 --- /dev/null +++ b/qt5-layer/recipes-qt/examples/cinematicexperience/fix-fullscreen-mode.patch @@ -0,0 +1,43 @@ +--- main.cpp.orig 2022-11-16 15:25:11.221100107 +0100 ++++ main.cpp 2022-11-18 09:30:01.084064039 +0100 +@@ -1,5 +1,22 @@ + #include <QGuiApplication> + #include <QQuickView> ++#include <QScreen> ++ ++void setFullscreen(QQuickView *view, const QScreen *screen) ++{ ++ QSize screenSize = screen->size(); ++ /* If we set fullscreen and screen size is 0,0 the application crashes. ++ * Therefore, we only set fullscreen mode when the screen size is big enough. ++ * We have to set visible false before we change the window state, else it ++ * won't update correctly and we might have a title bar */ ++ if ((screenSize.height() > 1) && (screenSize.width() > 1)) { ++ view->setVisible(false); ++ view->setWindowStates(Qt::WindowFullScreen); ++ } ++ ++ /* We always need to set visible to true, else the window will not show up */ ++ view->setVisible(true); ++} + + int main(int argc, char* argv[]) + { +@@ -10,9 +27,15 @@ + + const QString lowerArgument = QString::fromLatin1(argv[1]).toLower(); + if (lowerArgument == QLatin1String("--fullscreen")) { +- view.showFullScreen(); +- } else { ++ QObject::connect(&view, &QQuickView::screenChanged, &app, [&view](QScreen *screen) { ++ setFullscreen(&view, screen); ++ }, Qt::DirectConnection); ++ ++ setFullscreen(&view, view.screen()); ++ } ++ else { + view.show(); + } ++ + return app.exec(); + } diff --git a/qt5-layer/recipes-qt/examples/cinematicexperience_1.0.bbappend b/qt5-layer/recipes-qt/examples/cinematicexperience_1.0.bbappend new file mode 100644 index 0000000..e4d42f4 --- /dev/null +++ b/qt5-layer/recipes-qt/examples/cinematicexperience_1.0.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI:append = " file://fix-fullscreen-mode.patch" |