From 9dd5c2a7ecc861707ef2987259ab2aff047a741a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 16 Jun 2022 13:29:08 +1000 Subject: [PATCH] Fix error selecting the window scale in wayland Regression in [0] caused all output to be considered when updating after monitor outputs changed. [0]: ac2a56d7f3d6d20a0ed24ece11eea33e23d42f2c --- intern/ghost/intern/GHOST_WindowWayland.cpp | 10 +++++----- intern/ghost/intern/GHOST_WindowWayland.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp index dc5719e3b94..7265fe83c69 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cpp +++ b/intern/ghost/intern/GHOST_WindowWayland.cpp @@ -28,7 +28,7 @@ struct window_t { * This is an ordered set (whoever adds to this is responsible for keeping members unique). * In practice this is rarely manipulated and is limited by the number of physical displays. */ - std::vector outputs; + std::vector outputs; /** The scale value written to #wl_surface_set_buffer_scale. */ int scale = 0; @@ -233,7 +233,7 @@ static void surface_handle_enter(void *data, if (reg_output == nullptr) { return; } - std::vector &outputs = w->outputs(); + std::vector &outputs = w->outputs(); auto it = std::find(outputs.begin(), outputs.end(), reg_output); if (it != outputs.end()) { return; @@ -252,7 +252,7 @@ static void surface_handle_leave(void *data, if (reg_output == nullptr) { return; } - std::vector &outputs = w->outputs(); + std::vector &outputs = w->outputs(); auto it = std::find(outputs.begin(), outputs.end(), reg_output); if (it == outputs.end()) { return; @@ -408,7 +408,7 @@ wl_surface *GHOST_WindowWayland::surface() const return w->wl_surface; } -std::vector &GHOST_WindowWayland::outputs() +std::vector &GHOST_WindowWayland::outputs() { return w->outputs; } @@ -426,7 +426,7 @@ output_t *GHOST_WindowWayland::output_find_by_wl(struct wl_output *output) bool GHOST_WindowWayland::outputs_changed_update_scale() { uint32_t dpi_next; - const int scale_next = outputs_max_scale_or_default(this->m_system->outputs(), 0, &dpi_next); + const int scale_next = outputs_max_scale_or_default(this->outputs(), 0, &dpi_next); if (scale_next == 0) { return false; } diff --git a/intern/ghost/intern/GHOST_WindowWayland.h b/intern/ghost/intern/GHOST_WindowWayland.h index d7cd6608556..948635fc9ae 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.h +++ b/intern/ghost/intern/GHOST_WindowWayland.h @@ -103,7 +103,7 @@ class GHOST_WindowWayland : public GHOST_Window { struct wl_surface *surface() const; - std::vector &outputs(); + std::vector &outputs(); output_t *output_find_by_wl(struct wl_output *output);