summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-07-14 13:43:26 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-07-14 13:43:26 +0000
commite2504a0881b70867d1c49726010596ba5d12b870 (patch)
treea3cf25dc28c07f3e7c4513ff6a98cc6824209254 /src
parent7f526e136236802fccd9822ce87c509bf32e50d0 (diff)
- I had to revert SVN fix 4386 which simplified Carbon clipping, but also introduced unwanted overwriting of subwindows. The current code is slower, but correct, and should still perform well enough if here are no subwindows.
For FLTK2, this is no issue since subwindows and subgroups are implemented without OS support. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4416 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/fl_rect.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx
index 170003594..bf951c736 100644
--- a/src/fl_rect.cxx
+++ b/src/fl_rect.cxx
@@ -452,11 +452,35 @@ void fl_restore_clip() {
#ifdef WIN32
SelectClipRgn(fl_gc, r); //if r is NULL, clip is automatically cleared
#elif defined(__APPLE_QD__)
+# if 1
+ // This code is required to allow true subwindows to work on Mac.
+ // During regular operation however, this seems overkill.
+ // See also: Fl_Window::make_current()
+ if ( fl_window ) {
+ GrafPtr port = GetWindowPort( fl_window );
+ if ( port ) { // port will be NULL if we are using a GWorld (and fl_window_region is invalid)
+ RgnHandle portClip = NewRgn();
+ CopyRgn( fl_window_region, portClip ); // changed
+ if ( r )
+ SectRgn( portClip, r, portClip );
+ SetPortClipRegion( port, portClip );
+ DisposeRgn( portClip );
+ }
+ } else {
+ if (r)
+ SetClip(r);
+ else {
+ Rect rect; rect.left=0; rect.top=0; rect.right=0x7fff; rect.bottom=0x7fff;
+ ClipRect(&rect);
+ }
+ }
+# else
if (r) SetClip(r);
else {
Rect rect; rect.left=0; rect.top=0; rect.right=0x7fff; rect.bottom=0x7fff;
ClipRect(&rect);
}
+# endif
#elif defined(__APPLE_QUARTZ__)
if ( fl_window )
{