Fixed bug moving views from one window to another, which was causing the EOModeler inspector not to work on GNUstep (while it works on Apple)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30581 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2010-06-05 00:47:49 +00:00
parent 8b3c88167f
commit 7a98005c86
2 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2010-06-05 Nicola Pero <nicola.pero@meta-innovation.com>
* Source/GSWindowDecorationView.m ([-removeSubview:]): Uncommented
the method, fixing moving the content view from one window to
another one.
2010-06-01 Wolfgang Lux <wolfgang.lux@gmail.com> 2010-06-01 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSApplication.m (-finishLaunching): Do not attempt to * Source/NSApplication.m (-finishLaunching): Do not attempt to

View file

@ -190,12 +190,25 @@
styleMask: aStyle]; styleMask: aStyle];
} }
#if 0 /* If the contentView is removed from the window we must make sure the
* window no longer tries to access it. This situation may occur, for
* example, when people create inspectors where they want to swap in
* and out views. In the example I saw, a bunch of non-visible
* windows were created to create the inspector views. When an
* inspector view was needed, it was added as a subview in the visible
* inspector window. We need to make sure that when 'addSubview:' is
* called to add the view to another window, all references to it in
* the old window will automatically disappear (this is how it works
* on Apple too).
*/
- (void) removeSubview: (NSView*)aView - (void) removeSubview: (NSView*)aView
{ {
RETAIN(aView); RETAIN(aView);
/* /*
* If the content view is removed, we must let the window know. * If the content view is removed (for example, because it was added
* to another view in another window), we must let the window know.
* Otherwise, it would keep trying to resize/manage it as if it was
* its content view, while it actually is now in another window!
*/ */
[super removeSubview: aView]; [super removeSubview: aView];
if (aView == [_window contentView]) if (aView == [_window contentView])
@ -204,7 +217,6 @@
} }
RELEASE(aView); RELEASE(aView);
} }
#endif
- (void) setBackgroundColor: (NSColor *)color - (void) setBackgroundColor: (NSColor *)color
{ {