mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Minor improvements for Mac OS X scrollwheel code including 64-bit support. b=518542 r=mstange
This commit is contained in:
parent
9856ec25b6
commit
1ca4a76f17
@ -3543,8 +3543,6 @@ static const PRInt32 sShadowInvalidationInterval = 100;
|
|||||||
mGeckoChild->DispatchWindowEvent(geckoEvent);
|
mGeckoChild->DispatchWindowEvent(geckoEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
//XXXTODO handle scroll wheel events in 64-bit builds
|
|
||||||
#ifndef __LP64__
|
|
||||||
// Handle an NSScrollWheel event for a single axis only.
|
// Handle an NSScrollWheel event for a single axis only.
|
||||||
-(void)scrollWheel:(NSEvent*)theEvent forAxis:(enum nsMouseScrollEvent::nsMouseScrollFlags)inAxis
|
-(void)scrollWheel:(NSEvent*)theEvent forAxis:(enum nsMouseScrollEvent::nsMouseScrollFlags)inAxis
|
||||||
{
|
{
|
||||||
@ -3561,15 +3559,18 @@ static const PRInt32 sShadowInvalidationInterval = 100;
|
|||||||
if (prefs)
|
if (prefs)
|
||||||
prefs->GetBoolPref("mousewheel.enable_pixel_scrolling", &checkPixels);
|
prefs->GetBoolPref("mousewheel.enable_pixel_scrolling", &checkPixels);
|
||||||
|
|
||||||
EventRef theCarbonEvent = [theEvent _eventRef];
|
|
||||||
UInt32 carbonEventKind = theCarbonEvent ? ::GetEventKind(theCarbonEvent) : 0;
|
|
||||||
// Calling deviceDeltaX or deviceDeltaY on theEvent will trigger a Cocoa
|
// Calling deviceDeltaX or deviceDeltaY on theEvent will trigger a Cocoa
|
||||||
// assertion and an Objective-C NSInternalInconsistencyException if the
|
// assertion and an Objective-C NSInternalInconsistencyException if the
|
||||||
// underlying "Carbon" event doesn't contain pixel scrolling information.
|
// underlying "Carbon" event doesn't contain pixel scrolling information.
|
||||||
// For these events, carbonEventKind is kEventMouseWheelMoved instead of
|
// For these events, carbonEventKind is kEventMouseWheelMoved instead of
|
||||||
// kEventMouseScroll.
|
// kEventMouseScroll.
|
||||||
if (carbonEventKind != mozkEventMouseScroll)
|
if (checkPixels) {
|
||||||
checkPixels = PR_FALSE;
|
EventRef theCarbonEvent = [theEvent _eventRef];
|
||||||
|
UInt32 carbonEventKind = theCarbonEvent ? ::GetEventKind(theCarbonEvent) : 0;
|
||||||
|
if (carbonEventKind != mozkEventMouseScroll)
|
||||||
|
checkPixels = PR_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
// Some scrolling devices supports pixel scrolling, e.g. a Macbook
|
// Some scrolling devices supports pixel scrolling, e.g. a Macbook
|
||||||
// touchpad or a Mighty Mouse. On those devices, [event deviceDeltaX/Y]
|
// touchpad or a Mighty Mouse. On those devices, [event deviceDeltaX/Y]
|
||||||
// contains the amount of pixels to scroll.
|
// contains the amount of pixels to scroll.
|
||||||
@ -3615,8 +3616,9 @@ static const PRInt32 sShadowInvalidationInterval = 100;
|
|||||||
if (!mGeckoChild)
|
if (!mGeckoChild)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifndef NP_NO_CARBON
|
||||||
// dispatch scroll wheel carbon event for plugins
|
// dispatch scroll wheel carbon event for plugins
|
||||||
{
|
if (mPluginEventModel == NPEventModelCarbon) {
|
||||||
EventRef theEvent;
|
EventRef theEvent;
|
||||||
OSStatus err = ::CreateEvent(NULL,
|
OSStatus err = ::CreateEvent(NULL,
|
||||||
kEventClassMouse,
|
kEventClassMouse,
|
||||||
@ -3656,6 +3658,7 @@ static const PRInt32 sShadowInvalidationInterval = 100;
|
|||||||
ReleaseEvent(theEvent);
|
ReleaseEvent(theEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasPixels) {
|
if (hasPixels) {
|
||||||
@ -3694,7 +3697,6 @@ static const PRInt32 sShadowInvalidationInterval = 100;
|
|||||||
|
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
-(NSMenu*)menuForEvent:(NSEvent*)theEvent
|
-(NSMenu*)menuForEvent:(NSEvent*)theEvent
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user