From 2cbc743c6ad32c09c4dca68ab36a0f24307df0bf Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 25 May 2019 18:43:08 +0200 Subject: Slightly simplify Fl_X11_Window_Driver::capture_titlebar_and_borders() --- src/drivers/X11/Fl_X11_Window_Driver.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index ec3978ae8..34313ce26 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -399,15 +399,12 @@ void Fl_X11_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_R if (pWindow->decorated_h() == h()) return; Window from = fl_window; Fl_Surface_Device::push_current( Fl_Display_Device::display_device() ); - pWindow->show(); - Fl::check(); - pWindow->make_current(); - Window root, parent, *children, child_win; + Window root, parent, *children, child_win, xid = fl_xid(pWindow); unsigned n = 0; int do_it; int wsides, htop; - do_it = (XQueryTree(fl_display, fl_window, &root, &parent, &children, &n) != 0 && - XTranslateCoordinates(fl_display, fl_window, parent, 0, 0, &wsides, &htop, &child_win) == True); + do_it = (XQueryTree(fl_display, xid, &root, &parent, &children, &n) != 0 && + XTranslateCoordinates(fl_display, xid, parent, 0, 0, &wsides, &htop, &child_win) == True); if (n) XFree(children); if (!do_it) wsides = htop = 0; int hbottom = wsides; -- cgit v1.2.3