[Bf-blender-cvs] [9dd5c2a7ecc] master: Fix error selecting the window scale in wayland
Campbell Barton
noreply at git.blender.org
Thu Jun 16 06:28:32 CEST 2022
Commit: 9dd5c2a7ecc861707ef2987259ab2aff047a741a
Author: Campbell Barton
Date: Thu Jun 16 13:29:08 2022 +1000
Branches: master
https://developer.blender.org/rB9dd5c2a7ecc861707ef2987259ab2aff047a741a
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
===================================================================
M intern/ghost/intern/GHOST_WindowWayland.cpp
M intern/ghost/intern/GHOST_WindowWayland.h
===================================================================
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<const output_t *> outputs;
+ std::vector<output_t *> 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<const output_t *> &outputs = w->outputs();
+ std::vector<output_t *> &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<const output_t *> &outputs = w->outputs();
+ std::vector<output_t *> &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<const output_t *> &GHOST_WindowWayland::outputs()
+std::vector<output_t *> &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<const output_t *> &outputs();
+ std::vector<output_t *> &outputs();
output_t *output_find_by_wl(struct wl_output *output);
More information about the Bf-blender-cvs
mailing list