Changeset 13431 in webkit
- Timestamp:
- Mar 21, 2006 8:59:58 PM (18 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r13427 r13431 1 2006-03-21 Darin Adler <darin@apple.com> 2 3 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=3784 4 <rdar://problem/4483827> JavaScript save dialog disappears right away (sheet triggers blur event) (3784) 5 6 * WebView/WebHTMLView.m: 7 (-[WebHTMLView _updateFocusState]): Treat window as having focus if its sheet is key. 8 (-[WebHTMLView addWindowObservers]): Observe all focus notifications, not just the ones involving this window. 9 (-[WebHTMLView removeWindowObservers]): Ditto. 10 (-[WebHTMLView windowDidBecomeKey:]): Add checks so that we call the methods only when appropriate, 11 since this will now be called for all windows. 12 (-[WebHTMLView windowDidResignKey:]): Ditto. 13 1 14 2006-03-21 Adele Peterson <adele@apple.com> 2 15 -
trunk/WebKit/WebView/WebHTMLView.m
r13427 r13431 1 1 /* 2 * Copyright (C) 2005 Apple Computer, Inc. All rights reserved.2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 1624 1624 // so we can send focus and blur events. 1625 1625 1626 BOOL windowIsKey = [[self window] isKeyWindow]; 1626 NSWindow *window = [self window]; 1627 BOOL windowIsKey = [window isKeyWindow]; 1628 BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow]; 1629 1627 1630 BOOL displaysWithFocusAttributes = !_private->resigningFirstResponder && windowIsKey && [self _web_firstResponderCausesFocusDisplay]; 1628 1631 1629 [[self _bridge] setWindowHasFocus:window IsKey];1632 [[self _bridge] setWindowHasFocus:windowOrSheetIsKey]; 1630 1633 [[self _bridge] setDisplaysWithFocusAttributes:displaysWithFocusAttributes]; 1631 1634 } … … 2140 2143 if (window) { 2141 2144 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:) 2142 name:NSWindowDidBecomeKeyNotification object: window];2145 name:NSWindowDidBecomeKeyNotification object:nil]; 2143 2146 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidResignKey:) 2144 name:NSWindowDidResignKeyNotification object: window];2147 name:NSWindowDidResignKeyNotification object:nil]; 2145 2148 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:) 2146 2149 name:NSWindowWillCloseNotification object:window]; … … 2153 2156 if (window) { 2154 2157 [[NSNotificationCenter defaultCenter] removeObserver:self 2155 name:NSWindowDidBecomeKeyNotification object: window];2158 name:NSWindowDidBecomeKeyNotification object:nil]; 2156 2159 [[NSNotificationCenter defaultCenter] removeObserver:self 2157 name:NSWindowDidResignKeyNotification object: window];2160 name:NSWindowDidResignKeyNotification object:nil]; 2158 2161 [[NSNotificationCenter defaultCenter] removeObserver:self 2159 2162 name:NSWindowWillCloseNotification object:window]; … … 2557 2560 - (void)windowDidBecomeKey:(NSNotification *)notification 2558 2561 { 2559 ASSERT([notification object] == [self window]); 2560 [self addMouseMovedObserver]; 2561 [self _updateFocusState]; 2562 } 2563 2564 - (void)windowDidResignKey: (NSNotification *)notification 2565 { 2566 ASSERT([notification object] == [self window]); 2567 [_private->compController endRevertingChange:NO moveLeft:NO]; 2568 [self removeMouseMovedObserver]; 2569 [self _updateFocusState]; 2562 NSWindow *keyWindow = [notification object]; 2563 2564 if (keyWindow == [self window]) 2565 [self addMouseMovedObserver]; 2566 2567 if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet]) 2568 [self _updateFocusState]; 2569 } 2570 2571 - (void)windowDidResignKey:(NSNotification *)notification 2572 { 2573 NSWindow *formerKeyWindow = [notification object]; 2574 2575 if (formerKeyWindow == [self window]) 2576 [self removeMouseMovedObserver]; 2577 2578 if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) { 2579 [self _updateFocusState]; 2580 [_private->compController endRevertingChange:NO moveLeft:NO]; 2581 } 2570 2582 } 2571 2583
Note: See TracChangeset
for help on using the changeset viewer.