Commit 76691853 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Extract application-level handling of mouse move events to a separate method.

parent 79ef449e
......@@ -1134,23 +1134,7 @@ int macdrv_err_on;
return TRUE;
}
// Returns TRUE if the event was handled and caller should do nothing more
// with it. Returns FALSE if the caller should process it as normal and
// then call -didSendEvent:.
- (BOOL) handleEvent:(NSEvent*)anEvent
{
if ([anEvent type] == NSFlagsChanged)
self.lastFlagsChanged = anEvent;
return FALSE;
}
- (void) didSendEvent:(NSEvent*)anEvent
{
NSEventType type = [anEvent type];
if (type == NSMouseMoved || type == NSLeftMouseDragged ||
type == NSRightMouseDragged || type == NSOtherMouseDragged)
- (void) handleMouseMove:(NSEvent*)anEvent
{
WineWindow* targetWindow;
......@@ -1158,7 +1142,7 @@ int macdrv_err_on;
event indicates its window is the main window, even if the cursor is
over a different window. Find the actual WineWindow that is under the
cursor and post the event as being for that window. */
if (type == NSMouseMoved)
if ([anEvent type] == NSMouseMoved)
{
CGPoint cgpoint = CGEventGetLocation([anEvent CGEvent]);
NSPoint point = [self flippedMouseLocation:NSPointFromCGPoint(cgpoint)];
......@@ -1198,6 +1182,26 @@ int macdrv_err_on;
lastTargetWindow = nil;
}
}
// Returns TRUE if the event was handled and caller should do nothing more
// with it. Returns FALSE if the caller should process it as normal and
// then call -didSendEvent:.
- (BOOL) handleEvent:(NSEvent*)anEvent
{
if ([anEvent type] == NSFlagsChanged)
self.lastFlagsChanged = anEvent;
return FALSE;
}
- (void) didSendEvent:(NSEvent*)anEvent
{
NSEventType type = [anEvent type];
if (type == NSMouseMoved || type == NSLeftMouseDragged ||
type == NSRightMouseDragged || type == NSOtherMouseDragged)
{
[self handleMouseMove:anEvent];
}
else if (type == NSLeftMouseDown || type == NSLeftMouseUp ||
type == NSRightMouseDown || type == NSRightMouseUp ||
type == NSOtherMouseDown || type == NSOtherMouseUp ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment