diff --git a/ChangeLog b/ChangeLog index c2918abf8..b1bb8db35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-01-29 Fred Kiefer + + * Headers/Additions/GNUstepGUI/GSDisplayServer.h + (-setPartentWindow:forChildWindow:), + * Source/GSDisplayServer.m (-setPartentWindow:forChildWindow:): + New method. + * Source/NSWindow.m (-setParentWindow:, -_initBackendWindow): Use + this new method. + * Source/NSPopUpButtonCell.m (-attachPopUpWithFrame:inView:, + -dismissPopUp): Use child window mechanism for the popup menu. + 2009-01-28 Fred Kiefer * Source/NSWindow.m (GSWindowWithNumber): Protect agains diff --git a/Headers/Additions/GNUstepGUI/GSDisplayServer.h b/Headers/Additions/GNUstepGUI/GSDisplayServer.h index e7b6e7ead..215c5f021 100644 --- a/Headers/Additions/GNUstepGUI/GSDisplayServer.h +++ b/Headers/Additions/GNUstepGUI/GSDisplayServer.h @@ -162,6 +162,8 @@ APPKIT_EXPORT NSString * GSScreenNumber; - (void) imagecursor: (NSPoint)hotp : (int)w : (int)h : (int)colors : (const unsigned char *) image : (void**)cid; - (void) setcursorcolor: (NSColor *)fg : (NSColor *)bg : (void*)cid; +- (void) setPartentWindow: (int)partentWin + forChildWindow: (int)childWin; @end diff --git a/Source/GSDisplayServer.m b/Source/GSDisplayServer.m index c57fa9a3a..51c682bc0 100644 --- a/Source/GSDisplayServer.m +++ b/Source/GSDisplayServer.m @@ -896,6 +896,12 @@ GSCurrentServer(void) [self subclassResponsibility: _cmd]; } +- (void) setPartentWindow: (int)partentWin + forChildWindow: (int)childWin +{ + [self subclassResponsibility: _cmd]; +} + @end /* ----------------------------------------------------------------------- */ diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index c99959009..19fdc7bb1 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -828,7 +828,10 @@ static NSImage *_pbc_image[5]; onScreen: [cvWin screen] preferredEdge: _pbcFlags.preferredEdge popUpSelectedItem: selectedItem]; - + + // Set to be above the main window + [cvWin addChildWindow: [mr window] ordered: NSWindowAbove]; + // Last, display the window [[mr window] orderFrontRegardless]; @@ -844,11 +847,17 @@ static NSImage *_pbc_image[5]; - (void) dismissPopUp { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + NSMenuView *mr = [_menu menuRepresentation]; + NSWindow *mWin; [nc removeObserver: self name: NSMenuDidSendActionNotification object: _menu]; [_menu close]; + + // remove from main window + mWin = [mr window]; + [[mWin parentWindow] removeChildWindow: mWin]; } /* Private method handles all cases after doing a selection from diff --git a/Source/NSWindow.m b/Source/NSWindow.m index fbc82d4f5..cac4b6334 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -856,6 +856,9 @@ many times. : _styleMask : [_screen screenNumber]]; [srv setwindowlevel: [self level] : _windowNum]; + if (_parent != nil) + [srv setPartentWindow: [_parent windowNumber] + forChildWindow: _windowNum]; // Set up context [self _startBackendWindow]; @@ -4741,8 +4744,13 @@ current key view.
- (void) setParentWindow: (NSWindow *)window { - // FIXME _parent = window; + + if (_windowNum) + { + [GSServerForWindow(self) setPartentWindow: [_parent windowNumber] + forChildWindow: _windowNum]; + } } - (BOOL) allowsToolTipsWhenApplicationIsInactive