Bug 488260 - Minimum window size is incorrect when min. width or height is 0
Summary: Minimum window size is incorrect when min. width or height is 0
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: core (other bugs)
Version First Reported In: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-09 16:43 UTC by Nicolas Fella
Modified: 2024-06-10 12:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Fella 2024-06-09 16:43:05 UTC
Running the following QML code:
--------------
import QtQuick

Window {
    width: 500
    height: 500
    minimumHeight: 333
}
--------------

results in the minimum size being 150x150

Running with WAYLAND_DEBUG shows "xdg_toplevel#40.set_min_size(0, 333)", so KWin receives the correct size.

The problem is the use of isEmpty() in https://invent.kde.org/plasma/kwin/-/blob/master/src/wayland/xdgshell.cpp#L578 which is true because the width is 0.  This results in (0, 0) being passed to xdgshellwindow and later being expanded to (150, 150).

The resulting min. size should be (150, 333) or (0, 333)
Comment 1 Bug Janitor Service 2024-06-10 11:01:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5864
Comment 2 Vlad Zahorodnii 2024-06-10 12:38:53 UTC
Git commit 61332caa2026f10a43bbd9879c0c577188e5eef2 by Vlad Zahorodnii.
Committed on 10/06/2024 at 12:29.
Pushed by vladz into branch 'master'.

wayland: Fix one dimensional size constraints

QSize::isEmpty() will return true if either dimension is 0. On the other
hand, given the current language in the spec, it seems like the client
is allowed to set size constraints per dimension.

M  +10   -4    src/wayland/xdgshell.cpp

https://invent.kde.org/plasma/kwin/-/commit/61332caa2026f10a43bbd9879c0c577188e5eef2
Comment 3 Vlad Zahorodnii 2024-06-10 12:57:10 UTC
Git commit dde2a56f73d1beab049e1ebdec855f6cfe5798de by Vlad Zahorodnii.
Committed on 10/06/2024 at 12:39.
Pushed by vladz into branch 'Plasma/6.1'.

wayland: Fix one dimensional size constraints

QSize::isEmpty() will return true if either dimension is 0. On the other
hand, given the current language in the spec, it seems like the client
is allowed to set size constraints per dimension.
(cherry picked from commit 61332caa2026f10a43bbd9879c0c577188e5eef2)

M  +10   -4    src/wayland/xdgshell.cpp

https://invent.kde.org/plasma/kwin/-/commit/dde2a56f73d1beab049e1ebdec855f6cfe5798de