From 85724f00a0304619013f3b41f09288e757fa2149 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 28 Jun 2017 17:07:09 +0000 Subject: Better implementation of Fl_WinAPI_Window_Driver::reuse_cursor() that will also work with custom cursors. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12277 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_win32.cxx | 6 ++---- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H | 1 - src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 89d4d4685..7e99d76c0 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -2294,7 +2294,6 @@ int Fl_WinAPI_Window_Driver::set_cursor(Fl_Cursor c) { custom_cursor = 0; SetCursor(cursor); - current_cursor_ = c; return 1; } @@ -2318,12 +2317,11 @@ int Fl_WinAPI_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int } void Fl_WinAPI_Window_Driver::reuse_cursor(fl_uintptr_t c) { - // calling SetCursor(cursor) does not work, so we call the crossplatform API - pWindow->cursor((Fl_Cursor)c); + SetCursor((HCURSOR)c); } fl_uintptr_t Fl_WinAPI_Window_Driver::current_cursor() { - return (fl_uintptr_t)current_cursor_; + return (fl_uintptr_t)cursor; } diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index da65d7776..61d456edb 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -61,7 +61,6 @@ class FL_EXPORT Fl_WinAPI_Window_Driver : public Fl_Window_Driver HICON big_icon; HICON small_icon; }; - Fl_Cursor current_cursor_; private: void shape_bitmap_(Fl_Image* b); void shape_alpha_(Fl_Image* img, int offset); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index a32d423a9..0229f3cce 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -48,7 +48,6 @@ Fl_WinAPI_Window_Driver::Fl_WinAPI_Window_Driver(Fl_Window *win) icon_ = new icon_data; memset(icon_, 0, sizeof(icon_data)); cursor = NULL; - current_cursor_ = FL_CURSOR_DEFAULT; } -- cgit v1.2.3