diff --git a/examples/network/fortuneclient/client.cpp b/examples/network/fortuneclient/client.cpp
index b4c3d9328d62900cf57a3a53cff49a4e311151e8..42fed30445359ceed1d70202cfc85e182b8dce62 100644
--- a/examples/network/fortuneclient/client.cpp
+++ b/examples/network/fortuneclient/client.cpp
@@ -117,7 +117,7 @@ Client::Client(QWidget *parent)
 //! [4]
 
     QGridLayout *mainLayout = Q_NULLPTR;
-    if (QGuiApplication::styleHints()->showIsFullScreen()) {
+    if (QGuiApplication::styleHints()->showIsFullScreen() || QGuiApplication::styleHints()->showIsMaximized()) {
         QVBoxLayout *outerVerticalLayout = new QVBoxLayout(this);
         outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
         QHBoxLayout *outerHorizontalLayout = new QHBoxLayout;
diff --git a/examples/network/fortuneserver/server.cpp b/examples/network/fortuneserver/server.cpp
index 28f023089445e36aff7b9e50d22cfe46c6fb7987..089f594cabb011033972296fa580bf5c4da8cc2a 100644
--- a/examples/network/fortuneserver/server.cpp
+++ b/examples/network/fortuneserver/server.cpp
@@ -100,7 +100,7 @@ Server::Server(QWidget *parent)
         buttonLayout->addStretch(1);
 
         QVBoxLayout *mainLayout = Q_NULLPTR;
-        if (QGuiApplication::styleHints()->showIsFullScreen()) {
+        if (QGuiApplication::styleHints()->showIsFullScreen() || QGuiApplication::styleHints()->showIsMaximized()) {
             QVBoxLayout *outerVerticalLayout = new QVBoxLayout(this);
             outerVerticalLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding));
             QHBoxLayout *outerHorizontalLayout = new QHBoxLayout;