From bcdf4a4be16cd73a15643c67934d5a28f66a0a55 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 12 May 2011 11:50:43 +0000 Subject: Mac OS: simplified by removing Fl_X::contains_GL_subwindow() function. This operation is now performed within Fl_cocoa.mm git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8657 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/mac.H | 1 - src/Fl_Gl_Window.cxx | 1 - src/Fl_cocoa.mm | 9 ++++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/FL/mac.H b/FL/mac.H index d2398ce12..67307b0cf 100644 --- a/FL/mac.H +++ b/FL/mac.H @@ -140,7 +140,6 @@ public: int unlink(Fl_X* start = NULL); void collapse(void); WindowRef window_ref(void); - void contains_GL_subwindow(void); void set_key_window(void); void set_cursor(Fl_Cursor); static CGImageRef CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, int h); diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 33b0930cd..a7f6864bc 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -95,7 +95,6 @@ void Fl_Gl_Window::show() { if (overlay && overlay != this) ((Fl_Gl_Window*)overlay)->show(); #elif defined(__APPLE__) if( ! parent() ) need_redraw=1; - else Fl_X::i(window())->contains_GL_subwindow(); #endif } Fl_Window::show(); diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 2d1e45778..e1d556a1c 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2006,6 +2006,10 @@ void Fl_X::make(Fl_Window* w) Fl::e_number = old_event; w->redraw(); // force draw to happen } + if (w->as_gl_window()) { // if creating a sub-GL-window + while (win->window()) win = win->window(); + [(FLWindow*)Fl_X::i(win)->xid setContainsGLsubwindow:YES]; + } fl_show_iconic = 0; } else { // create a desktop window @@ -3362,11 +3366,6 @@ CGImageRef Fl_X::CGImage_from_window_rect(Fl_Window *win, int x, int y, int w, i return img; } -void Fl_X::contains_GL_subwindow() -{ - [(FLWindow*)xid setContainsGLsubwindow:YES]; -} - WindowRef Fl_X::window_ref() { return (WindowRef)[(FLWindow*)xid windowRef]; -- cgit v1.2.3