WebKit Bugzilla
Attachment 358441 Details for
Bug 189621
: It should be possible to get the mouse event modifiers from an injected bundle.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189621-20190105121248.patch (text/plain), 2.77 KB, created by
Per Arne Vollan
on 2019-01-05 12:13:07 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2019-01-05 12:13:07 PST
Size:
2.77 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 239658) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2019-01-05 Per Arne Vollan <pvollan@apple.com> >+ >+ It should be possible to get the mouse event modifiers for a page overlay client. >+ https://bugs.webkit.org/show_bug.cgi?id=189621 >+ <rdar://problem/44437279> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When access to the WindowServer is blocked, [NSEvent modifierFlags] always returns 0. >+ This can be fixed by swizzling the class method, and getting the cached modifiers from >+ PlatformKeyboardEvent. >+ >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::currentModifierFlags): >+ (WebKit::WebProcess::platformInitializeProcess): >+ > 2019-01-04 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Use save sheet instead of dialog where possible >Index: Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >=================================================================== >--- Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (revision 239657) >+++ Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (working copy) >@@ -349,6 +349,27 @@ void WebProcess::registerWithStateDumper > } > #endif > >+#if PLATFORM(MAC) && ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >+static NSEventModifierFlags currentModifierFlags(id self, SEL _cmd) >+{ >+ auto currentModifiers = PlatformKeyboardEvent::currentStateOfModifierKeys(); >+ NSEventModifierFlags modifiers = 0; >+ >+ if (currentModifiers.contains(PlatformEvent::Modifier::ShiftKey)) >+ modifiers |= NSEventModifierFlagShift; >+ if (currentModifiers.contains(PlatformEvent::Modifier::CtrlKey)) >+ modifiers |= NSEventModifierFlagControl; >+ if (currentModifiers.contains(PlatformEvent::Modifier::AltKey)) >+ modifiers |= NSEventModifierFlagOption; >+ if (currentModifiers.contains(PlatformEvent::Modifier::MetaKey)) >+ modifiers |= NSEventModifierFlagCommand; >+ if (currentModifiers.contains(PlatformEvent::Modifier::CapsLockKey)) >+ modifiers |= NSEventModifierFlagCapsLock; >+ >+ return modifiers; >+} >+#endif >+ > void WebProcess::platformInitializeProcess(const ChildProcessInitializationParameters& parameters) > { > #if PLATFORM(MAC) >@@ -365,6 +386,10 @@ void WebProcess::platformInitializeProce > // This is necessary so that we are able to set the process' display name. > _RegisterApplication(nullptr, nullptr); > >+ // Swizzle [NSEvent modiferFlags], since it always returns 0 when the WindowServer is blocked. >+ Method method = class_getClassMethod(objc_getClass("NSEvent"), @selector(modifierFlags)); >+ method_setImplementation(method, (IMP)currentModifierFlags); >+ > #else > > if (![NSApp isRunning]) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dbates
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189621
:
349766
|
350029
| 358441 |
362309