From cfbee55c2a05c0d12f8636a2cc59f0635e0a66c5 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 10 Jun 2024 15:10:45 +0300 Subject: [PATCH] wayland: Initialize xdg-toplevel size hints to 0,0 QSize() initializes the width and the height to -1x-1 by default. --- src/wayland/xdgshell.cpp | 7 +++---- src/wayland/xdgshell_p.h | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/wayland/xdgshell.cpp b/src/wayland/xdgshell.cpp index 2c5845fc67..afe54e54cb 100644 --- a/src/wayland/xdgshell.cpp +++ b/src/wayland/xdgshell.cpp @@ -378,8 +378,8 @@ void XdgToplevelInterfacePrivate::reset() windowTitle = QString(); windowClass = QString(); - minimumSize = QSize(); - maximumSize = QSize(); + minimumSize = QSize(0, 0); + maximumSize = QSize(0, 0); pending = XdgToplevelCommit{}; stashed.clear(); @@ -579,8 +579,7 @@ QString XdgToplevelInterface::windowClass() const QSize XdgToplevelInterface::minimumSize() const { - return QSize(d->minimumSize.width() > 0 ? d->minimumSize.width() : 0, - d->minimumSize.height() > 0 ? d->minimumSize.height() : 0); + return d->minimumSize; } QSize XdgToplevelInterface::maximumSize() const diff --git a/src/wayland/xdgshell_p.h b/src/wayland/xdgshell_p.h index 8e9329ae0a..5d90806354 100644 --- a/src/wayland/xdgshell_p.h +++ b/src/wayland/xdgshell_p.h @@ -148,8 +148,8 @@ public: XdgSurfaceInterface *xdgSurface; QString windowTitle; QString windowClass; - QSize minimumSize; - QSize maximumSize; + QSize minimumSize = QSize(0, 0); + QSize maximumSize = QSize(0, 0); protected: void xdg_toplevel_destroy_resource(Resource *resource) override;