[Bf-blender-cvs] [3ac656d3677] master: GHOST/Wayland: set the minimum window size
Campbell Barton
noreply at git.blender.org
Sun Jun 12 10:23:41 CEST 2022
Commit: 3ac656d36779ef81e451544bbf7641870f4854d9
Author: Campbell Barton
Date: Sun Jun 12 18:21:23 2022 +1000
Branches: master
https://developer.blender.org/rB3ac656d36779ef81e451544bbf7641870f4854d9
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.
===================================================================
M intern/ghost/intern/GHOST_WindowWayland.cpp
===================================================================
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);
More information about the Bf-blender-cvs
mailing list