diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-12 11:21:23 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-12 11:21:23 +0300 |
commit | 3ac656d36779ef81e451544bbf7641870f4854d9 (patch) | |
tree | 45cb1014db0574f8027f9fb0c7b0e10a37038501 /intern | |
parent | 7a849678c93ec907fc98b0d30c0c9fd0664ca04c (diff) |
GHOST/Wayland: set the minimum window size
Setting Blender's window 1x1 can happen by accident & causes problems,
set the minimum size as all other GHOST implementations do.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWayland.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp index 685fcedd649..68d50c597d6 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cpp +++ b/intern/ghost/intern/GHOST_WindowWayland.cpp @@ -256,6 +256,12 @@ GHOST_WindowWayland::GHOST_WindowWayland(GHOST_SystemWayland *system, w->xdg_surface = xdg_wm_base_get_xdg_surface(m_system->shell(), w->surface); w->xdg_toplevel = xdg_surface_get_toplevel(w->xdg_surface); + /* NOTE: The limit is in points (not pixels) so Hi-DPI will limit to larger number of pixels. + * This has the advantage that the size limit is the same when moving the window between monitors + * with different scales set. If it was important to limit in pixels it could be re-calculated + * when the `w->scale` changed. */ + xdg_toplevel_set_min_size(w->xdg_toplevel, 320, 240); + if (m_system->decoration_manager()) { w->xdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration( m_system->decoration_manager(), w->xdg_toplevel); |