summaryrefslogtreecommitdiff
path: root/src/drivers/X11/Fl_X11_Window_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-21 17:06:03 +0000
committerManolo Gouy <Manolo>2016-03-21 17:06:03 +0000
commit9ba3889ae5a7054b4d75c0ccb0f54e16b9b99159 (patch)
treeb2ce871a08ae2dea72d686ed7fe4a50a5eaa47be /src/drivers/X11/Fl_X11_Window_Driver.cxx
parentec0b695709edee8aaf1a85c7c4c284e15502fadc (diff)
Implement Fl_Window::make_current() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11393 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/X11/Fl_X11_Window_Driver.cxx')
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx
index 0b35c8969..2fa295560 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -23,6 +23,7 @@
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_Overlay_Window.H>
#include <FL/fl_draw.H>
+#include <FL/fl_ask.H>
#include <FL/Fl.H>
#include <string.h>
#if HAVE_DLFCN_H
@@ -31,6 +32,9 @@
#define ShapeBounding 0
#define ShapeSet 0
+Window fl_window;
+
+
#if USE_XDBE
#include <X11/extensions/Xdbe.h>
@@ -422,6 +426,23 @@ void Fl_X11_Window_Driver::wait_for_expose() {
}
}
+
+// make X drawing go into this window (called by subclass flush() impl.)
+void Fl_X11_Window_Driver::make_current() {
+ if (!pWindow->shown()) {
+ fl_alert("Fl_Window::make_current(), but window is not shown().");
+ Fl::fatal("Fl_Window::make_current(), but window is not shown().");
+ }
+ fl_window = fl_xid(pWindow);
+ fl_graphics_driver->clip_region(0);
+
+#ifdef FLTK_USE_CAIRO
+ // update the cairo_t context
+ if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow);
+#endif
+}
+
+
//
// End of "$Id$".
//