WebKit Bugzilla
Attachment 362309 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-20190218120917.patch (text/plain), 3.22 KB, created by
Per Arne Vollan
on 2019-02-18 12:09:18 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2019-02-18 12:09:18 PST
Size:
3.22 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 241730) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2019-02-15 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 Daniel Bates. >+ >+ 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-02-18 Dean Jackson <dino@apple.com> > > iOS Safari will not load USDZ in QLPreview when opening as BLOB >Index: Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm >=================================================================== >--- Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm (revision 241730) >+++ Source/WebKit/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm (working copy) >@@ -36,6 +36,7 @@ > #import "WebProcessCreationParameters.h" > #import <CoreFoundation/CFURL.h> > #import <Foundation/NSBundle.h> >+#import <WebCore/PlatformKeyboardEvent.h> > #import <dlfcn.h> > #import <objc/runtime.h> > #import <pal/spi/cocoa/NSKeyedArchiverSPI.h> >@@ -51,6 +52,27 @@ - (CFBundleRef)_cfBundle; > namespace WebKit { > using namespace WebCore; > >+#if 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::ControlKey)) >+ 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 >+ > bool InjectedBundle::initialize(const WebProcessCreationParameters& parameters, API::Object* initializationUserData) > { > if (m_sandboxExtension) { >@@ -117,6 +139,12 @@ bool InjectedBundle::initialize(const We > } > #endif > >+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) >+ // Swizzle [NSEvent modiferFlags], since it always returns 0 when the WindowServer is blocked. >+ Method method = class_getClassMethod([NSEvent class], @selector(modifierFlags)); >+ method_setImplementation(method, reinterpret_cast<IMP>(currentModifierFlags)); >+#endif >+ > if (!initializeFunction) > initializeFunction = bitwise_cast<WKBundleInitializeFunctionPtr>(CFBundleGetFunctionPointerForName([m_platformBundle _cfBundle], CFSTR("WKBundleInitialize"))); >
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189621
:
349766
|
350029
|
358441
| 362309