summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-02-19 11:52:45 +0000
committerManolo Gouy <Manolo>2016-02-19 11:52:45 +0000
commit6d766cc6814a9e7a04c0b147c7a3cbdc0817dfd4 (patch)
treec15758e6d6a729de86408157f539ef10479a382c /src
parentf33b45f1d30653fb5da4817089e38ff0a2413cfb (diff)
Update the fl_gc global variable also when Fl_Graphics_Driver::set_gc() is called.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11190 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.h2
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h2
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.h b/src/drivers/GDI/Fl_GDI_Graphics_Driver.h
index 722c7410a..6fd93dbfc 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.h
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.h
@@ -43,7 +43,7 @@ public:
const char *class_name() {return class_id;};
virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
char can_do_alpha_blending();
- virtual void set_gc(void *ctxt) {gc = (HDC)ctxt;}
+ virtual void set_gc(void *ctxt) {if (ctxt != gc) global_gc(); gc = (HDC)ctxt;}
virtual void *get_gc() {return gc;}
// --- bitmap stuff
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h
index c9a6c916e..3e069040f 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h
@@ -44,7 +44,7 @@ public:
static const char *class_id;
const char *class_name() {return class_id;};
virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
- virtual void set_gc(void *ctxt) {gc = (CGContextRef)ctxt;}
+ virtual void set_gc(void *ctxt) {if (ctxt != gc) global_gc(); gc = (CGContextRef)ctxt; }
virtual void *get_gc() {return gc;}
char can_do_alpha_blending();
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
index b9ac31eff..0a7950388 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
@@ -37,7 +37,6 @@ GC fl_gc = 0;
void Fl_Graphics_Driver::global_gc()
{
- fl_gc = (GC)get_gc();
}
@@ -57,6 +56,7 @@ Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) {
fl_open_display();
// the unique GC used by all X windows
gc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0);
+ fl_gc = gc;
}
}