diff options
author | Campbell Barton <campbell@blender.org> | 2022-07-15 08:42:24 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-07-15 08:42:24 +0300 |
commit | d8094f9212c1703e6230825780c06beb630f6d19 (patch) | |
tree | 7fb03e97a8d205c8b6d2f155b96e33391ae613e1 /intern | |
parent | 60f260eb6a21a1bf7ef92ae2a09eb107bbcb0e4a (diff) |
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.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWayland.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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 = { |