summaryrefslogtreecommitdiff
path: root/src/drivers/X11/Fl_X11_Screen_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-04-26 16:53:08 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-04-26 16:53:08 +0200
commit02373a9dea876e5346e623bcff8a06af4bccccb9 (patch)
tree453147535a954275c6193d76435b5af4c7dc620b /src/drivers/X11/Fl_X11_Screen_Driver.cxx
parente8fa4922641568b0e5972885a19c71887c8ff5d2 (diff)
X11: fix capture of window decoration under xfce
Diffstat (limited to 'src/drivers/X11/Fl_X11_Screen_Driver.cxx')
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index 270504fd7..02ab347b2 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -665,10 +665,10 @@ Fl_RGB_Image *Fl_X11_Screen_Driver::read_win_rectangle(int X, int Y, int w, int
//
int allow_outside = w < 0; // negative w allows negative X or Y, that is, window frame
if (w < 0) w = - w;
-
+// when capturing window decoration, X,Y,w and h are in pixels (not in FLTK units).
Window xid = (win && !allow_outside ? fl_xid(win) : fl_window);
- float s = allow_outside ? Fl::screen_driver()->scale(win->screen_num()) : Fl_Surface_Device::surface()->driver()->scale();
+ float s = allow_outside ? 1 : Fl_Surface_Device::surface()->driver()->scale();
int Xs = Fl_Scalable_Graphics_Driver::floor(X, s);
int Ys = Fl_Scalable_Graphics_Driver::floor(Y, s);
int ws = Fl_Scalable_Graphics_Driver::floor(X+w, s) - Xs;