From f459fdb6374a81a7ebb2fdc95e6dd7ec7041c3ec Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 13 Feb 2023 12:11:04 +0100 Subject: Allow scaled image in Fl_Window::cursor(const Fl_RGB_Image *, int, int) --- src/Fl_x.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Fl_x.cxx') diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 6855f9915..0a8f80d50 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2934,6 +2934,7 @@ int Fl_X11_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int ho if (!cursor) return 0; + image = (Fl_RGB_Image*)image->copy(); const int extra_data = image->ld() ? (image->ld()-image->w()*image->d()) : 0; const uchar *i = (const uchar*)*image->data(); XcursorPixel *o = cursor->pixels; @@ -2984,7 +2985,7 @@ int Fl_X11_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int ho XFreeCursor(fl_display, xc); XcursorImageDestroy(cursor); - + delete image; return 1; #endif } -- cgit v1.2.3