Reviewed by Eric.
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Apr 2006 23:48:23 +0000 (23:48 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Apr 2006 23:48:23 +0000 (23:48 +0000)
        http://bugzilla.opendarwin.org/show_bug.cgi?id=8514
        Bug 8514: Web Inspector hides when the app is in the background

        Makes the inspector not hide in the background. Since the inspector is a floating panel
        we need to call setFloatingPanel:NO when the app is switching into the background. Then
        call setFloatingPanel:YES when the app is activated again. Without this the inspector
        would float above all applications.

        * WebInspector/WebInspector.m:
        (-[NSWindow window]): setHidesOnDeactivate:NO
        (-[NSWindow windowWillClose:]): de-regiser appliction active notifications
        (-[NSWindow showWindow:]): register for appliction active notifications
        (-[WebInspector _applicationWillResignActive]): setFloatingPanel:NO
        (-[WebInspector _applicationDidBecomeActive]): setFloatingPanel:YES

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@14020 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/ChangeLog
WebKit/WebInspector/WebInspector.m

index 39e63874bd90b35fabb9f76ba7100f6428c96d16..af648773db2531e7659fbf5d0758d9732167b4f6 100644 (file)
@@ -1,3 +1,22 @@
+2006-04-22  Timothy Hatcher  <timothy@apple.com>
+
+        Reviewed by Eric.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=8514
+        Bug 8514: Web Inspector hides when the app is in the background
+
+        Makes the inspector not hide in the background. Since the inspector is a floating panel
+        we need to call setFloatingPanel:NO when the app is switching into the background. Then
+        call setFloatingPanel:YES when the app is activated again. Without this the inspector
+        would float above all applications.
+
+        * WebInspector/WebInspector.m:
+        (-[NSWindow window]): setHidesOnDeactivate:NO
+        (-[NSWindow windowWillClose:]): de-regiser appliction active notifications
+        (-[NSWindow showWindow:]): register for appliction active notifications
+        (-[WebInspector _applicationWillResignActive]): setFloatingPanel:NO
+        (-[WebInspector _applicationDidBecomeActive]): setFloatingPanel:YES
+
 2006-04-21  Adele Peterson  <adele@apple.com>
 
         Reviewed by Darin.
index c30f159b96440cb43c9e9f723a49b98090171f05..d814a8c0a1316246c5653c3f95018c58db4e0884 100644 (file)
@@ -113,6 +113,7 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
         [window setFloatingPanel:YES];
         [window setReleasedWhenClosed:YES];
         [window setMovableByWindowBackground:YES];
+        [window setHidesOnDeactivate:NO];
         [window setDelegate:self];
         [window setMinSize:NSMakeSize(280.0, 450.0)];
 
@@ -138,6 +139,8 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
 
 - (void)windowWillClose:(NSNotification *)notification
 {
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationWillResignActiveNotification object:nil];
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSApplicationDidBecomeActiveNotification object:nil];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:WebNodeHighlightExpiredNotification object:nil];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:NSViewFrameDidChangeNotification object:nil];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:NSSystemColorsDidChangeNotification object:nil];
@@ -150,6 +153,8 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
 {
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_nodeHighlightExpired:) name:WebNodeHighlightExpiredNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_updateSystemColors) name:NSSystemColorsDidChangeNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillResignActive) name:NSApplicationWillResignActiveNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationDidBecomeActive) name:NSApplicationDidBecomeActiveNotification object:nil];
 
     [self _update];
     [self _updateSystemColors];
@@ -746,6 +751,16 @@ static NSMapTable *lastChildIgnoringWhitespaceCache = NULL;
     [style setTextContent:styleText];
 }
 
+- (void)_applicationWillResignActive
+{
+    [(NSPanel *)[self window] setFloatingPanel:NO];
+}
+
+- (void)_applicationDidBecomeActive
+{
+    [(NSPanel *)[self window] setFloatingPanel:YES];
+}
+
 #pragma mark -
 
 + (BOOL)isSelectorExcludedFromWebScript:(SEL)aSelector