summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-17 10:12:42 +0000
committerManolo Gouy <Manolo>2016-04-17 10:12:42 +0000
commita4e5dc0267bf972b5897aec0f167b3e2d9488a8c (patch)
tree5f18230489a8b69d63e883eb75585477056ddb72 /src/Fl_cocoa.mm
parent16beb869a506107a8286bc225a152766a8a7a798 (diff)
Move q_release_context() from class Fl_X to class Fl_Cocoa_Window_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11639 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 368fec105..fe224206e 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -875,7 +875,7 @@ double fl_mac_flush_and_wait(double time_to_wait) {
if (Fl::idle && !in_idle) // 'idle' may have been set within flush()
time_to_wait = 0.0;
double retval = fl_wait(time_to_wait);
- Fl_X::q_release_context();
+ Fl_Cocoa_Window_Driver::q_release_context();
[pool release];
return retval;
}
@@ -2876,7 +2876,7 @@ void Fl_X::flush()
through_Fl_X_flush = NO;
if (!through_drawRect) [[xid contentView] unlockFocus];
make_current_counts = 0;
- Fl_X::q_release_context();
+ Fl_Cocoa_Window_Driver::q_release_context();
}
}
@@ -3255,7 +3255,7 @@ void Fl_Cocoa_Window_Driver::make_current()
{
if (make_current_counts > 1) return;
if (make_current_counts) make_current_counts++;
- Fl_X::q_release_context();
+ q_release_context();
Fl_X *i = Fl_X::i(pWindow);
fl_window = i->xid;
Fl_X::set_high_resolution( i->mapped_to_retina() );
@@ -3295,9 +3295,9 @@ void Fl_Cocoa_Window_Driver::make_current()
}
// Give the Quartz context back to the system
-void Fl_X::q_release_context(Fl_X *x) {
+void Fl_Cocoa_Window_Driver::q_release_context(Fl_Cocoa_Window_Driver *x) {
CGContextRef gc = (CGContextRef)Fl_Display_Device::display_device()->driver()->gc();
- if (x && ((Fl_Cocoa_Window_Driver*)x->w->pWindowDriver)->gc != gc) return;
+ if (x && x->shown() && x->gc != gc) return;
if (!gc) return;
CGContextRestoreGState(gc); // match the CGContextSaveGState's of make_current
CGContextRestoreGState(gc);