summaryrefslogtreecommitdiff
path: root/src/drivers/X11/Fl_X11_Window_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-06-06 18:28:49 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2019-06-06 18:28:49 +0200
commit94fffb701ce88adf7398fb37a007a04c08f1ca6f (patch)
tree39c02278fa18939ebf7d5df8e1459e5297c086ea /src/drivers/X11/Fl_X11_Window_Driver.cxx
parent50b1c0878085b5f231616d78f1f1775874b1c9ae (diff)
Add one argument to Fl_Screen_Driver::read_win_rectangle()
The new argument gives the window to be captured, or NULL to indicate capture from the current offscreen. Calling this function becomes easier because less dependent on global variables.
Diffstat (limited to 'src/drivers/X11/Fl_X11_Window_Driver.cxx')
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx
index e2ed5d073..1de2e5297 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -392,16 +392,14 @@ void Fl_X11_Window_Driver::free_icons() {
This function exploits a feature of Fl_X11_Screen_Driver::read_win_rectangle() which,
when called with negative 3rd argument, captures the window decoration.
- Other requirements to capture the window decoration:
- - fl_window is the parent window of the top window
- - Fl_Window::current() is the top window
+ Other requirement to capture the window decoration:
+ fl_window is the parent window of the top window
*/
void Fl_X11_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_RGB_Image*& left, Fl_RGB_Image*& bottom, Fl_RGB_Image*& right)
{
top = left = bottom = right = NULL;
if (pWindow->decorated_h() == h()) return;
Window from = fl_window;
- Fl_Window *oldcurrent = Fl_Window::current();
Window root, parent, *children, child_win, xid = fl_xid(pWindow);
unsigned n = 0;
int do_it;
@@ -414,25 +412,23 @@ void Fl_X11_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_R
float s = Fl::screen_driver()->scale(screen_num());
htop /= s; wsides /= s;
fl_window = parent;
- current(pWindow);
if (htop) {
- top = Fl::screen_driver()->read_win_rectangle(0, 0, - (w() + 2 * wsides), htop);
+ top = Fl::screen_driver()->read_win_rectangle(0, 0, - (w() + 2 * wsides), htop, pWindow);
if (top) top->scale(w() + 2 * wsides, htop, 0, 1);
}
if (wsides) {
- left = Fl::screen_driver()->read_win_rectangle(0, htop, -wsides, h());
+ left = Fl::screen_driver()->read_win_rectangle(0, htop, -wsides, h(), pWindow);
if (left) {
left->scale(wsides, h(), 0, 1);
}
- right = Fl::screen_driver()->read_win_rectangle(w() + wsides, htop, -wsides, h());
+ right = Fl::screen_driver()->read_win_rectangle(w() + wsides, htop, -wsides, h(), pWindow);
if (right) {
right->scale(wsides, h(), 0, 1);
}
- bottom = Fl::screen_driver()->read_win_rectangle(0, htop + h(), -(w() + 2*wsides), hbottom);
+ bottom = Fl::screen_driver()->read_win_rectangle(0, htop + h(), -(w() + 2*wsides), hbottom, pWindow);
if (bottom) {
bottom->scale(w() + 2*wsides, wsides, 0, 1);
} }
- current(oldcurrent);
fl_window = from;
}