diff options
| author | Manolo Gouy <Manolo> | 2017-06-28 15:15:34 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-06-28 15:15:34 +0000 |
| commit | 582701ba07b1c4f61771dbc1d9d93ba02abbe5e6 (patch) | |
| tree | bf1467edf818881c3d8a9f16615fb9254c3e3b66 | |
| parent | 322b62a9f126987914193dedbc892b8e5c17f453 (diff) | |
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
| -rw-r--r-- | FL/Fl_Window_Driver.H | 1 | ||||
| -rw-r--r-- | src/Fl_Screen_Driver.cxx | 1 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 7 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Window_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Window_Driver.cxx | 5 |
6 files changed, 15 insertions, 1 deletions
diff --git a/FL/Fl_Window_Driver.H b/FL/Fl_Window_Driver.H index 202fcb9e7..20e3503fc 100644 --- a/FL/Fl_Window_Driver.H +++ b/FL/Fl_Window_Driver.H @@ -162,6 +162,7 @@ public: // --- window icon stuff virtual void icons(const Fl_RGB_Image *icons[], int count) {} + virtual void reuse_icons() {} virtual const void *icon() const {return NULL;} virtual void icon(const void * ic) {} virtual void free_icons() {} diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index 811dd1c34..29fcffd14 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -375,6 +375,7 @@ void Fl_Screen_Driver::rescale_all_windows_from_screen(int screen, float f) } win->show(); win->driver()->reuse_cursor(current); + win->driver()->reuse_icons(); win->wait_for_expose(); } delete[] win_array; 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) diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H index 756a98946..700992dad 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.H +++ b/src/drivers/X11/Fl_X11_Window_Driver.H @@ -135,6 +135,7 @@ public: virtual void shape(const Fl_Image* img); virtual void icons(const Fl_RGB_Image *icons[], int count); + virtual void reuse_icons(); virtual const void *icon() const; virtual void icon(const void * ic); virtual void free_icons(); diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index a8952eed3..ed5597e84 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -356,6 +356,11 @@ void Fl_X11_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_X11_Window_Driver::reuse_icons() +{ if (Fl_X::i(pWindow)) set_icons(); } |
