зеркало из https://github.com/mozilla/pjs.git
take key modifiers from the current event not the current hardware state. b=320746 r=smichaud sr=roc
This commit is contained in:
Родитель
6a81962067
Коммит
03afe204b5
|
@ -2885,7 +2885,7 @@ static void InitializeEventRecord(EventRecord* event)
|
||||||
memset(event, 0, sizeof(EventRecord));
|
memset(event, 0, sizeof(EventRecord));
|
||||||
::GetGlobalMouse(&event->where);
|
::GetGlobalMouse(&event->where);
|
||||||
event->when = ::TickCount();
|
event->when = ::TickCount();
|
||||||
event->modifiers = ::GetCurrentKeyModifiers();
|
event->modifiers = ::GetCurrentEventKeyModifiers();
|
||||||
}
|
}
|
||||||
|
|
||||||
NPDrawingModel nsPluginInstanceOwner::GetDrawingModel()
|
NPDrawingModel nsPluginInstanceOwner::GetDrawingModel()
|
||||||
|
|
|
@ -2687,7 +2687,7 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
if (GetCurrentKeyModifiers() & optionKey)
|
if (GetCurrentEventKeyModifiers() & optionKey)
|
||||||
gSafeMode = PR_TRUE;
|
gSafeMode = PR_TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1886,7 +1886,7 @@ NS_IMETHODIMP nsChildView::GetToggledKeyState(PRUint32 aKeyCode,
|
||||||
default:
|
default:
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
PRUint32 modifierFlags = ::GetCurrentKeyModifiers();
|
PRUint32 modifierFlags = ::GetCurrentEventKeyModifiers();
|
||||||
*aLEDState = (modifierFlags & key) != 0;
|
*aLEDState = (modifierFlags & key) != 0;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
|
@ -2834,7 +2834,7 @@ NSEvent* gLastDragEvent = nil;
|
||||||
macEvent.message = 0;
|
macEvent.message = 0;
|
||||||
macEvent.when = ::TickCount();
|
macEvent.when = ::TickCount();
|
||||||
::GetGlobalMouse(&macEvent.where);
|
::GetGlobalMouse(&macEvent.where);
|
||||||
macEvent.modifiers = GetCurrentKeyModifiers();
|
macEvent.modifiers = ::GetCurrentEventKeyModifiers();
|
||||||
geckoEvent.nativeMsg = &macEvent;
|
geckoEvent.nativeMsg = &macEvent;
|
||||||
|
|
||||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||||
|
@ -2870,7 +2870,7 @@ NSEvent* gLastDragEvent = nil;
|
||||||
macEvent.message = 0;
|
macEvent.message = 0;
|
||||||
macEvent.when = ::TickCount();
|
macEvent.when = ::TickCount();
|
||||||
::GetGlobalMouse(&macEvent.where);
|
::GetGlobalMouse(&macEvent.where);
|
||||||
macEvent.modifiers = GetCurrentKeyModifiers();
|
macEvent.modifiers = ::GetCurrentEventKeyModifiers();
|
||||||
geckoEvent.nativeMsg = &macEvent;
|
geckoEvent.nativeMsg = &macEvent;
|
||||||
|
|
||||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||||
|
@ -2900,7 +2900,7 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
|
||||||
macEvent.message = 0;
|
macEvent.message = 0;
|
||||||
macEvent.when = ::TickCount();
|
macEvent.when = ::TickCount();
|
||||||
::GetGlobalMouse(&macEvent.where);
|
::GetGlobalMouse(&macEvent.where);
|
||||||
macEvent.modifiers = ::GetCurrentKeyModifiers();
|
macEvent.modifiers = ::GetCurrentEventKeyModifiers();
|
||||||
event.nativeMsg = &macEvent;
|
event.nativeMsg = &macEvent;
|
||||||
|
|
||||||
nsEventStatus status;
|
nsEventStatus status;
|
||||||
|
@ -3021,7 +3021,7 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
|
||||||
macEvent.message = 0;
|
macEvent.message = 0;
|
||||||
macEvent.when = ::TickCount();
|
macEvent.when = ::TickCount();
|
||||||
::GetGlobalMouse(&macEvent.where);
|
::GetGlobalMouse(&macEvent.where);
|
||||||
macEvent.modifiers = GetCurrentKeyModifiers();
|
macEvent.modifiers = ::GetCurrentEventKeyModifiers();
|
||||||
geckoEvent.nativeMsg = &macEvent;
|
geckoEvent.nativeMsg = &macEvent;
|
||||||
|
|
||||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||||
|
@ -3058,7 +3058,7 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted,
|
||||||
macEvent.message = 0;
|
macEvent.message = 0;
|
||||||
macEvent.when = ::TickCount();
|
macEvent.when = ::TickCount();
|
||||||
::GetGlobalMouse(&macEvent.where);
|
::GetGlobalMouse(&macEvent.where);
|
||||||
macEvent.modifiers = btnState | ::GetCurrentKeyModifiers();
|
macEvent.modifiers = btnState | ::GetCurrentEventKeyModifiers();
|
||||||
geckoEvent.nativeMsg = &macEvent;
|
geckoEvent.nativeMsg = &macEvent;
|
||||||
|
|
||||||
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
mGeckoChild->DispatchMouseEvent(geckoEvent);
|
||||||
|
@ -3467,7 +3467,7 @@ static void ConvertCocoaKeyEventToMacEvent(NSEvent* cocoaEvent, EventRecord& mac
|
||||||
macEvent.message = (charCode & 0x00FF) | ([cocoaEvent keyCode] << 8);
|
macEvent.message = (charCode & 0x00FF) | ([cocoaEvent keyCode] << 8);
|
||||||
macEvent.when = ::TickCount();
|
macEvent.when = ::TickCount();
|
||||||
::GetGlobalMouse(&macEvent.where);
|
::GetGlobalMouse(&macEvent.where);
|
||||||
macEvent.modifiers = ::GetCurrentKeyModifiers();
|
macEvent.modifiers = ::GetCurrentEventKeyModifiers();
|
||||||
|
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ else
|
||||||
ifeq (WINNT,$(OS_ARCH))
|
ifeq (WINNT,$(OS_ARCH))
|
||||||
CPPSRCS += nsUserInfoWin.cpp
|
CPPSRCS += nsUserInfoWin.cpp
|
||||||
else
|
else
|
||||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
||||||
CPPSRCS += \
|
CPPSRCS += \
|
||||||
nsUserInfoMac.cpp \
|
nsUserInfoMac.cpp \
|
||||||
nsCommandLineServiceMac.cpp \
|
nsCommandLineServiceMac.cpp \
|
||||||
|
|
|
@ -139,15 +139,10 @@ nsresult nsMacCommandLine::Initialize(int& argc, char**& argv)
|
||||||
mArgsAllocated = kArgsGrowSize;
|
mArgsAllocated = kArgsGrowSize;
|
||||||
mArgsUsed = 0;
|
mArgsUsed = 0;
|
||||||
|
|
||||||
#if defined(XP_MACOSX)
|
|
||||||
// Here, we may actually get useful args.
|
// Here, we may actually get useful args.
|
||||||
// Copy them first to mArgv.
|
// Copy them first to mArgv.
|
||||||
for (int arg = 0; arg < argc; arg++)
|
for (int arg = 0; arg < argc; arg++)
|
||||||
AddToCommandLine(argv[arg]);
|
AddToCommandLine(argv[arg]);
|
||||||
#else
|
|
||||||
// init the args buffer with the program name
|
|
||||||
AddToCommandLine("mozilla");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Set up AppleEvent handling.
|
// Set up AppleEvent handling.
|
||||||
OSErr err = CreateAEHandlerClasses(false);
|
OSErr err = CreateAEHandlerClasses(false);
|
||||||
|
@ -176,7 +171,7 @@ nsresult nsMacCommandLine::Initialize(int& argc, char**& argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetCurrentKeyModifiers() & optionKey)
|
if (::GetCurrentEventKeyModifiers() & optionKey)
|
||||||
AddToCommandLine("-p");
|
AddToCommandLine("-p");
|
||||||
|
|
||||||
// we've started up now
|
// we've started up now
|
||||||
|
|
Загрузка…
Ссылка в новой задаче