[Bf-blender-cvs] [d8094f9212c] master: GHOST/Wayland: partial support for updating the UI scale

Campbell Barton noreply at git.blender.org
Fri Jul 15 07:44:24 CEST 2022


Commit: d8094f9212c1703e6230825780c06beb630f6d19
Author: Campbell Barton
Date:   Fri Jul 15 15:42:24 2022 +1000
Branches: master
https://developer.blender.org/rBd8094f9212c1703e6230825780c06beb630f6d19

GHOST/Wayland: partial support for updating the UI scale

Partial support for changing the UI scale while Blender is open.

The scale is set but issues with the window size not updating remain.

===================================================================

M	intern/ghost/intern/GHOST_SystemWayland.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 4124cd059b3..d7520f1243f 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -2597,7 +2597,17 @@ static void output_handle_done(void *data, struct wl_output * /*wl_output*/)
 
 static void output_handle_scale(void *data, struct wl_output * /*wl_output*/, const int32_t factor)
 {
+  CLOG_INFO(LOG, 2, "scale");
   static_cast<output_t *>(data)->scale = factor;
+
+  if (window_manager) {
+    for (GHOST_IWindow *iwin : window_manager->getWindows()) {
+      GHOST_WindowWayland *win = static_cast<GHOST_WindowWayland *>(iwin);
+      win->outputs_changed_update_scale();
+      /* TODO(@campbellbarton): support refreshing the UI when the DPI changes.
+       * There are glitches when resizing the monitor which would be nice to solve. */
+    }
+  }
 }
 
 static const struct wl_output_listener output_listener = {



More information about the Bf-blender-cvs mailing list