summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-06-19 17:48:37 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-06-19 17:48:37 +0200
commitc43cf2f19243057fe8b02410bb11669a720e2ca8 (patch)
tree2e23d30eabb3168e0c01f5c1cff86bd7416c089c /src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx
parent742af8a31a8627bdfc1ed4d14cdc73c396c015f6 (diff)
Wayland: improve support of multi-display setups
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx
index c3d8a977c..b1c34b2ec 100644
--- a/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx
@@ -22,9 +22,12 @@
Fl_Wayland_Copy_Surface_Driver::Fl_Wayland_Copy_Surface_Driver(int w, int h) : Fl_Copy_Surface_Driver(w, h) {
- int os_scale =
- (Fl_Wayland_Window_Driver::wld_window && Fl_Wayland_Window_Driver::wld_window->output ?
- Fl_Wayland_Window_Driver::wld_window->output->wld_scale : 1);
+ struct Fl_Wayland_Window_Driver::surface_output *s_output = NULL;
+ if (Fl_Wayland_Window_Driver::wld_window &&
+ !wl_list_empty(&Fl_Wayland_Window_Driver::wld_window->outputs)) {
+ s_output = wl_container_of(Fl_Wayland_Window_Driver::wld_window->outputs.next, s_output, link);
+ }
+ int os_scale = (s_output ? s_output->output->wld_scale : 1);
img_surf = new Fl_Image_Surface(w * os_scale, h * os_scale);
driver(img_surf->driver());
driver()->scale(os_scale);