summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
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/Fl_cocoa.mm
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/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 40d984f0a..7ee2877b6 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -94,7 +94,6 @@ void *fl_capture = 0; // (NSWindow*) we need this to compensate for a missing(
bool fl_show_iconic; // true if called from iconize() - shows the next created window in collapsed state
//int fl_disable_transient_for; // secret method of removing TRANSIENT_FOR
Window fl_window;
-Fl_Window *Fl_Window::current_;
// forward declarations of variables in this file
static int got_events = 0;
@@ -3266,14 +3265,14 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
Subsequent drawing requests go to this window. CAUTION: it's not possible to call Fl::wait(),
Fl::check() nor Fl::ready() while in the draw() function of a widget. Use an idle callback instead.
*/
-void Fl_Window::make_current()
+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();
+ Fl_X *i = Fl_X::i(pWindow);
fl_window = i->xid;
Fl_X::set_high_resolution( i->mapped_to_retina() );
- current_ = this;
NSGraphicsContext *nsgc;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
@@ -3299,13 +3298,13 @@ void Fl_Window::make_current()
// this is the context with origin at top left of (sub)window
CGContextSaveGState(i->gc);
#if defined(FLTK_USE_CAIRO)
- if (Fl::cairo_autolink_context()) Fl::cairo_make_current(this); // capture gc changes automatically to update the cairo context adequately
+ if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); // capture gc changes automatically to update the cairo context adequately
#endif
fl_clip_region( 0 );
#if defined(FLTK_USE_CAIRO)
// update the cairo_t context
- if (Fl::cairo_autolink_context()) Fl::cairo_make_current(this);
+ if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow);
#endif
}
@@ -4274,11 +4273,6 @@ CGImageRef Fl_X::CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, i
return img;
}
-WindowRef Fl_X::window_ref() // useless with cocoa GL windows
-{
- return (WindowRef)[xid windowRef];
-}
-
// so a CGRect matches exactly what is denoted x,y,w,h for clipping purposes
CGRect fl_cgrectmake_cocoa(int x, int y, int w, int h) {
return CGRectMake(x - 0.5, y - 0.5, w, h);