summaryrefslogtreecommitdiff
path: root/src/Fl_Screen_Driver.H
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-08-21 12:01:01 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-08-21 12:01:51 +0200
commit33eb87940dcc672ac50a3c1a26b437e7f1320112 (patch)
tree41b5bb34424657f9670f812abe8c8e446fddb3ff /src/Fl_Screen_Driver.H
parent5255640e7a09f4310946bdd36a3db33c69f5b356 (diff)
Fix a case when fl_read_window() did not capture subwindows correctly.
The case was under macOS with a non-GL parent window mapped to a retina display containing a GL subwindow and if the app did not call Fl::use_high_res_GL(1).
Diffstat (limited to 'src/Fl_Screen_Driver.H')
-rw-r--r--src/Fl_Screen_Driver.H22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/Fl_Screen_Driver.H b/src/Fl_Screen_Driver.H
index 511f892d2..05924812c 100644
--- a/src/Fl_Screen_Driver.H
+++ b/src/Fl_Screen_Driver.H
@@ -136,16 +136,17 @@ public:
// we no longer need the on-screen keyboard; it's up to the system to hide it
virtual void release_keyboard() { }
- // read raw image from a window or an offscreen buffer
- /* Member function read_win_rectangle() supports the public function
- fl_read_image() which captures pixel data either from
- the current window or from an offscreen buffer.
-
- With fl_read_image() and for capture from a window, the returned pixel array
- also contains data from any embedded sub-window.
+ /* Member function read_win_rectangle() supports public functions
+ fl_read_image() and fl_capture_window_part() which capture pixel data from
+ a window (or also from an offscreen buffer with fl_read_image).
- In the case of read_win_rectangle() and for capture from a window, only data
- from the current window is collected.
+ If 'may_capture_subwins' is true, an implementation may or may not capture
+ also the content of subwindows embedded in 'win'. If subwindows were captured,
+ *'did_capture_subwins' is returned set to true. If read_win_rectangle()
+ is called with 'may_capture_subwins' set to true, 'did_capture_subwins' should
+ be set before the call to the address of a boolean set to false.
+ The implementation of this virtual function for the macOS platform has the
+ capability of capturing subwindows when asked for.
A platform may also use its read_win_rectangle() implementation to capture
window decorations (e.g., title bar). In that case, it is called by
@@ -153,7 +154,8 @@ public:
win is the window to capture from, or NULL to capture from the current offscreen
*/
- virtual Fl_RGB_Image *read_win_rectangle(int X, int Y, int w, int h, Fl_Window *win) {return NULL;}
+ virtual Fl_RGB_Image *read_win_rectangle(int X, int Y, int w, int h, Fl_Window *win,
+ bool may_capture_subwins = false, bool *did_capture_subwins = NULL) {return NULL;}
static void write_image_inside(Fl_RGB_Image *to, Fl_RGB_Image *from, int to_x, int to_y);
static Fl_RGB_Image *traverse_to_gl_subwindows(Fl_Group *g, int x, int y, int w, int h,
Fl_RGB_Image *full_img);