Changeset 19166
- Timestamp:
- 01/26/07 16:03:56 (22 months ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 modified
-
ChangeLog (modified) (1 diff)
-
page/EventHandler.cpp (modified) (1 diff)
-
page/EventHandler.h (modified) (1 diff)
-
page/mac/EventHandlerMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r19164 r19166 1 2007-01-26 Beth Dakin <bdakin@apple.com> 2 3 Reviewed by Darin. 4 5 Fix for <rdar://problem/4956565> REGRESSION: After scrolling frame, 6 hovering over link in this frame doesn't change cursor to pointing 7 hand 8 9 The mouseMove event was not being propagated correctly after using 10 the mouse to scroll the frame because m_mousePressed was never 11 getting set to false. 12 13 * page/EventHandler.cpp: 14 (WebCore::EventHandler::handleMousePressEvent): This code does not 15 belong here. 16 * page/EventHandler.h: lastEventIsMouseUp() is only ever relevant 17 in EventHandlerMac, so it can just be a static function there. 18 * page/mac/EventHandlerMac.mm: 19 (WebCore::lastEventIsMouseUp): Make this static. 20 (WebCore::EventHandler::passMouseDownEventToWidget): Here is where 21 we need to set m_mousePressed to false if lastEventIsMouseUp() is 22 true. 23 1 24 2007-01-26 David Hyatt <hyatt@apple.com> 2 25 -
trunk/WebCore/page/EventHandler.cpp
r19158 r19166 748 748 else 749 749 swallowEvent = handleMousePressEvent(mev); 750 751 // Many AK widgets run their own event loops and consume events while the mouse is down.752 // When they finish, currentEvent is the mouseUp that they exited on. We need to update753 // the khtml state with this mouseUp, which khtml never saw.754 // If this event isn't a mouseUp, we assume that the mouseUp will be coming later. There755 // is a hole here if the widget consumes the mouseUp and subsequent events.756 if (lastEventIsMouseUp())757 m_mousePressed = false;758 750 } 759 751 -
trunk/WebCore/page/EventHandler.h
r19108 r19166 167 167 void hoverTimerFired(Timer<EventHandler>*); 168 168 169 bool lastEventIsMouseUp() const;170 171 169 static bool canMouseDownStartSelect(Node*); 172 170 -
trunk/WebCore/page/mac/EventHandlerMac.mm
r19108 r19166 203 203 } 204 204 205 static bool lastEventIsMouseUp() 206 { 207 // Many AK widgets run their own event loops and consume events while the mouse is down. 208 // When they finish, currentEvent is the mouseUp that they exited on. We need to update 209 // the khtml state with this mouseUp, which khtml never saw. This method lets us detect 210 // that state. 211 212 BEGIN_BLOCK_OBJC_EXCEPTIONS; 213 NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent]; 214 if (currentEvent != currentEventAfterHandlingMouseDown && 215 [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp && 216 [currentEventAfterHandlingMouseDown timestamp] >= [currentEvent timestamp]) 217 return true; 218 END_BLOCK_OBJC_EXCEPTIONS; 219 220 return false; 221 } 222 205 223 bool EventHandler::passMouseDownEventToWidget(Widget* widget) 206 224 { … … 273 291 m_mouseDownView = view; 274 292 m_mouseDownWasInSubframe = false; 293 294 // Many AppKit widgets run their own event loops and consume events while the mouse is down. 295 // When they finish, currentEvent is the mouseUp that they exited on. We need to update 296 // the EventHandler state with this mouseUp, which we never saw. 297 // If this event isn't a mouseUp, we assume that the mouseUp will be coming later. There 298 // is a hole here if the widget consumes both the mouseUp and subsequent events. 299 if (lastEventIsMouseUp()) 300 m_mousePressed = false; 275 301 276 302 END_BLOCK_OBJC_EXCEPTIONS; 277 303 278 304 return true; 279 }280 281 bool EventHandler::lastEventIsMouseUp() const282 {283 // Many AK widgets run their own event loops and consume events while the mouse is down.284 // When they finish, currentEvent is the mouseUp that they exited on. We need to update285 // the khtml state with this mouseUp, which khtml never saw. This method lets us detect286 // that state.287 288 BEGIN_BLOCK_OBJC_EXCEPTIONS;289 NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent];290 if (currentEvent != currentEventAfterHandlingMouseDown &&291 [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp &&292 [currentEventAfterHandlingMouseDown timestamp] >= [currentEvent timestamp])293 return true;294 END_BLOCK_OBJC_EXCEPTIONS;295 296 return false;297 305 } 298 306