From 582701ba07b1c4f61771dbc1d9d93ba02abbe5e6 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 28 Jun 2017 15:15:34 +0000 Subject: HiDPI support: keep window's icons after rescaling git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12276 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H | 1 + src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/drivers/WinAPI') diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index f1d1f6e23..da65d7776 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -109,6 +109,7 @@ public: virtual const void *icon() const; virtual void icon(const void * ic); virtual void free_icons(); + virtual void reuse_icons(); void set_icons(); // driver-internal support function // this one is implemented in Fl_win32.cxx virtual void capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx index af5a04b6e..a32d423a9 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx @@ -347,6 +347,11 @@ void Fl_WinAPI_Window_Driver::icons(const Fl_RGB_Image *icons[], int count) { icon_->icons[i] = (Fl_RGB_Image*)((Fl_RGB_Image*)icons[i])->copy(); } + reuse_icons(); +} + +void Fl_WinAPI_Window_Driver::reuse_icons() +{ if (Fl_X::i(pWindow)) set_icons(); } @@ -443,7 +448,7 @@ void Fl_WinAPI_Window_Driver::hide() { if (hide_common()) return; // make sure any custom icons get freed - icons(NULL, 0); +// icons(NULL, 0); // free_icons() is called by the Fl_Window destructor // this little trick keeps the current clipboard alive, even if we are about // to destroy the window that owns the selection. if (GetClipboardOwner()==ip->xid) -- cgit v1.2.3