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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to