diff --git a/ChangeLog b/ChangeLog index 1bb9803d0..48bf9f887 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ Add some documentation. * Source/NSWindow.m ([NSWindow -dealloc]): Check for context before undefining gstate. + ([NSWindow -miniaturize:]): Don't create miniwindow if server + can't handle it. + * Source/GSDisplayServer.m (-appOwnsMiniwindow): Implement. 2002-04-01 Gregory Casamento diff --git a/Headers/gnustep/gui/GSDisplayServer.h b/Headers/gnustep/gui/GSDisplayServer.h index 809c426d7..3f58424c6 100644 --- a/Headers/gnustep/gui/GSDisplayServer.h +++ b/Headers/gnustep/gui/GSDisplayServer.h @@ -95,6 +95,7 @@ GSDisplayServer * GSCurrentServer(void); - (void) windowbacking: (NSBackingStoreType)type; - (void) titlewindow: (NSString *) window_title : (int) win; - (void) miniwindow: (int) win; +- (BOOL) appOwnsMiniwindow; - (void) windowdevice: (int) win; - (void) orderwindow: (int) op : (int) otherWin : (int) win; - (void) movewindow: (NSPoint)loc : (int) win; diff --git a/Source/GSDisplayServer.m b/Source/GSDisplayServer.m index dae7af6e3..acf1efeab 100644 --- a/Source/GSDisplayServer.m +++ b/Source/GSDisplayServer.m @@ -461,6 +461,16 @@ GSCurrentServer(void) [self subclassResponsibility: _cmd]; } +/** Returns YES if the application should create the miniwindow counterpart + to the full size window and own it. Some display systems handle the + miniwindow themselves. In this case the backend subclass should + override this method to return NO. */ +- (BOOL) appOwnsMiniwindow +{ + return YES; +} + + /** Sets the window drawable for the current NSGraphicsContext, typically by calling [NSGraphicsContext -DPSsetgcdrawable::::], although depending on the concrete implmentation, more information diff --git a/Source/NSWindow.m b/Source/NSWindow.m index 2bcc9ae97..75c4625c0 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -2101,6 +2101,7 @@ resetCursorRectsForView(NSView *theView) the screen and it's counterpart (mini)window is displayed. */ - (void) miniaturize: (id)sender { + GSDisplayServer *srv = GSServerForWindow(self); [nc postNotificationName: NSWindowWillMiniaturizeNotification object: self]; @@ -2113,7 +2114,7 @@ resetCursorRectsForView(NSView *theView) /* * Ensure that we have a miniwindow counterpart. */ - if (_counterpart == 0) + if (_counterpart == 0 && [srv appOwnsMiniwindow]) { NSWindow *mini; NSMiniWindowView *v; @@ -2131,7 +2132,7 @@ resetCursorRectsForView(NSView *theView) RELEASE(v); } [self _lossOfKeyOrMainWindow]; - [GSServerForWindow(self) miniwindow: _windowNum]; + [srv miniwindow: _windowNum]; _f.visible = NO; [nc postNotificationName: NSWindowDidMiniaturizeNotification