summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-04-12 09:20:34 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-04-12 09:20:34 +0200
commitfad867a5d37b5162255a338f5f5218ff852f8852 (patch)
treeab4bda71568da79af50fc8699a7a2fb2b41cbc94 /src/drivers
parent0d59e32b848953be121a86ccd068847dfa28d8fc (diff)
Modify test/cairo_test.cxx to show roles of OPTION_CAIRO and OPTION_CAIROEXT.
Also make clear that these options require, for now, Fl_Double_Window to work cross-platform.
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx8
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.cxx3
2 files changed, 10 insertions, 1 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 52116778c..ab4bbfdee 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -1,7 +1,7 @@
//
// Definition of Windows window driver for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2021 by Bill Spitzak and others.
+// Copyright 1998-2022 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -320,6 +320,9 @@ void Fl_WinAPI_Window_Driver::flush_double()
int savedc = SaveDC(fl_gc);
fl_graphics_driver->gc(fl_gc);
fl_graphics_driver->restore_clip(); // duplicate clip region into new gc
+# if defined(FLTK_HAVE_CAIROEXT)
+ if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow);
+# endif
draw();
RestoreDC(fl_gc, savedc);
DeleteDC(fl_gc);
@@ -422,6 +425,9 @@ void Fl_WinAPI_Window_Driver::make_current() {
fl_graphics_driver->clip_region(0);
((Fl_GDI_Graphics_Driver*)fl_graphics_driver)->scale(Fl::screen_driver()->scale(screen_num()));
+#if defined(FLTK_HAVE_CAIROEXT)
+ if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow);
+#endif
}
void Fl_WinAPI_Window_Driver::label(const char *name,const char *iname) {
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx
index 5cf8bc59d..725f8f5e0 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -156,6 +156,9 @@ void Fl_X11_Window_Driver::flush_double(int erase_overlay)
if (pWindow->damage() & ~FL_DAMAGE_EXPOSE) {
fl_clip_region(i->region); i->region = 0;
fl_window = other_xid;
+# if defined(FLTK_HAVE_CAIROEXT)
+ if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow);
+# endif
draw();
fl_window = i->xid;
}