diff options
| author | Manolo Gouy <Manolo> | 2017-06-28 13:33:53 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2017-06-28 13:33:53 +0000 |
| commit | 322b62a9f126987914193dedbc892b8e5c17f453 (patch) | |
| tree | 2fefd2fb327f9caaed1f1d7798818767598db136 /src/Fl_x.cxx | |
| parent | 9041a3dc70aa376896f992c43ec1a6d63a9a8d1a (diff) | |
HiDPI support: keep window's cursor after rescaling.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12275 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_x.cxx')
| -rw-r--r-- | src/Fl_x.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 00d985582..71d9d95a6 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2420,9 +2420,6 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) fl_background_pixel = -1; mask |= CWBackPixel; } - // reproduce the window cursor if a window is hidden and then recreated (e.g., rescaled) - attr.cursor = Fl_X11_Window_Driver::driver(win)->current_cursor_; - mask |= CWCursor; float s = 1; #if USE_XFT //compute adequate screen where to put the window @@ -2885,6 +2882,7 @@ int Fl_X11_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int ho xc = XcursorImageLoadCursor(fl_display, cursor); XDefineCursor(fl_display, fl_xid(pWindow), xc); + current_cursor_ = xc; XFreeCursor(fl_display, xc); XcursorImageDestroy(cursor); @@ -2893,6 +2891,13 @@ int Fl_X11_Window_Driver::set_cursor(const Fl_RGB_Image *image, int hotx, int ho #endif } +void Fl_X11_Window_Driver::reuse_cursor(fl_uintptr_t c) +{ + if (c) { + XDefineCursor(fl_display, fl_xid(pWindow), (Cursor)c); + } +} + //////////////////////////////////////////////////////////////// // returns pointer to the filename, or null if name ends with '/' |
