From e4d4f400a4b42f4713f2d2dc5e29b0c73a7717f1 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 11 Nov 2014 16:08:09 +0000 Subject: Added support of true subwindows to the Mac OS X code. With this, a window inside another window is just another window with Mac OS as it was already with MSWindows and X11. This requires Mac OS X 10.2. Window nesting to any depth is possible. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10449 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src/Fl.cxx') diff --git a/src/Fl.cxx b/src/Fl.cxx index e800d79e7..a08b095ec 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -681,20 +681,13 @@ Fl_X* Fl_X::first; Fl_Window* fl_find(Window xid) { Fl_X *window; for (Fl_X **pp = &Fl_X::first; (window = *pp); pp = &window->next) -#if defined(WIN32) || defined(USE_X11) - if (window->xid == xid) -#elif defined(__APPLE_QUARTZ__) - if (window->xid == xid && !window->w->window()) -#else -# error unsupported platform -#endif // __APPLE__ - { + if (window->xid == xid) { if (window != Fl_X::first && !Fl::modal()) { - // make this window be first to speed up searches - // this is not done if modal is true to avoid messing up modal stack - *pp = window->next; - window->next = Fl_X::first; - Fl_X::first = window; + // make this window be first to speed up searches + // this is not done if modal is true to avoid messing up modal stack + *pp = window->next; + window->next = Fl_X::first; + Fl_X::first = window; } return window->w; } @@ -1505,7 +1498,6 @@ void Fl_Window::hide() { for (; *pp != ip; pp = &(*pp)->next) if (!*pp) return; *pp = ip->next; #ifdef __APPLE__ - ip->unlink(); // MacOS X manages a single pointer per application. Make sure that hiding // a toplevel window will not leave us with some random pointer shape, or // worst case, an invisible pointer @@ -1556,7 +1548,7 @@ void Fl_Window::hide() { } #elif defined(__APPLE_QUARTZ__) Fl_X::q_release_context(ip); - if ( ip->xid == fl_window && !parent() ) + if ( ip->xid == fl_window ) fl_window = 0; #endif @@ -1584,6 +1576,7 @@ void Fl_Window::hide() { if (count) delete[] doit; #elif defined(__APPLE_QUARTZ__) ip->destroy(); + delete ip->subRect; #else # error unsupported platform #endif -- cgit v1.2.3