summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/Wayland')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H1
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx7
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
index b757a8a6e..8578bc59a 100644
--- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H
@@ -56,6 +56,7 @@ public:
static struct wl_shm_pool *current_pool;
void copy_offscreen(int x, int y, int w, int h, Fl_Offscreen osrc,
int srcx, int srcy) FL_OVERRIDE;
+ void cache_size(Fl_Image *img, int &width, int &height) FL_OVERRIDE;
static struct wld_buffer *create_wld_buffer(int width, int height, bool with_shm = true);
static void create_shm_buffer(wld_buffer *buffer);
static void buffer_release(struct wld_window *window);
diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
index 34e4971da..b2def3703 100644
--- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
@@ -287,3 +287,10 @@ Fl_Image_Surface *Fl_Wayland_Graphics_Driver::custom_offscreen(int w, int h,
cairo_set_user_data(off->draw_buffer.cairo_, &key, &off->draw_buffer, NULL);
return new Fl_Image_Surface(w, h, 0, (Fl_Offscreen)off->draw_buffer.cairo_);
}
+
+
+void Fl_Wayland_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height) {
+ Fl_Graphics_Driver::cache_size(img, width, height);
+ width *= wld_scale;
+ height *= wld_scale;
+}
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 0b228d83a..83865878a 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -370,6 +370,7 @@ void Fl_Wayland_Window_Driver::make_current() {
}
((Fl_Wayland_Graphics_Driver*)fl_graphics_driver)->set_cairo(
window->buffer->draw_buffer.cairo_, f * wld_s);
+ ((Fl_Cairo_Graphics_Driver*)fl_graphics_driver)->wld_scale = wld_s;
int *poffset = Fl_Window_Driver::menu_offset_y(pWindow);
if (poffset) { // for tall menu windows under KWIN to offset drawing inside window
cairo_translate(window->buffer->draw_buffer.cairo_, 0, *poffset);