WebKit Bugzilla
Attachment 350015 Details for
Bug 189697
: [WPE] Implement mouse event modifiers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189697-20180918150324.patch (text/plain), 7.10 KB, created by
Claudio Saavedra
on 2018-09-18 05:03:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Claudio Saavedra
Created:
2018-09-18 05:03:25 PDT
Size:
7.10 KB
patch
obsolete
>Subversion Revision: 236062 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9eecaf4d9880645ad0b1a7fde928d6f8ac2cc50d..af55781dcfb1a504c14a84758dcd1d79b9089c96 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-09-18 Claudio Saavedra <csaavedra@igalia.com> >+ >+ [WPE] Implement mouse event modifiers >+ https://bugs.webkit.org/show_bug.cgi?id=189697 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Only "CapsLocks" is missing, as WPE doesn't support that modifier. >+ * Shared/wpe/WebEventFactory.cpp: >+ (WebKit::modifiersForEventModifiers): >+ (WebKit::WebEventFactory::createWebKeyboardEvent): >+ (WebKit::WebEventFactory::createWebMouseEvent): >+ (WebKit::modifiersForEvent): Deleted. >+ > 2018-09-17 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, fix incorrect WPE build fix made in r236009 >diff --git a/Source/WebKit/Shared/wpe/WebEventFactory.cpp b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >index 2a2f519f878bd6c2cbd64f74a867a86c8e4ef0a2..b718c901c74bc0878a2cab30b6f85ecb23ba8284 100644 >--- a/Source/WebKit/Shared/wpe/WebEventFactory.cpp >+++ b/Source/WebKit/Shared/wpe/WebEventFactory.cpp >@@ -38,10 +38,9 @@ static inline bool isWPEKeyCodeFromKeyPad(unsigned keyCode) > return keyCode >= WPE_KEY_KP_Space && keyCode <= WPE_KEY_KP_9; > } > >-static WebEvent::Modifiers modifiersForEvent(struct wpe_input_keyboard_event* event) >+static WebEvent::Modifiers modifiersForEventModifiers(unsigned eventModifiers) > { > unsigned modifiers = 0; >- unsigned eventModifiers = event->modifiers; > > if (eventModifiers & wpe_input_keyboard_modifier_control) > modifiers |= WebEvent::ControlKey; >@@ -77,7 +76,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(struct wpe_input_keyboa > WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode(event->key_code), > event->key_code, > isWPEKeyCodeFromKeyPad(event->key_code), >- modifiersForEvent(event), >+ modifiersForEventModifiers(event->modifiers), > wallTimeForEventTime(event->time)); > } > >@@ -137,11 +136,11 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(struct wpe_input_pointer_even > > unsigned clickCount = (type == WebEvent::MouseDown) ? 1 : 0; > >- // FIXME: Proper button support. Modifiers. deltaX/Y/Z. Click count. >+ // FIXME: Proper button support. deltaX/Y/Z. Click count. > WebCore::IntPoint position(event->x, event->y); > position.scale(1 / deviceScaleFactor); > return WebMouseEvent(type, button, pressedMouseButtons(event->modifiers), position, position, >- 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), wallTimeForEventTime(event->time)); >+ 0, 0, 0, clickCount, modifiersForEventModifiers(event->modifiers), wallTimeForEventTime(event->time)); > } > > WebWheelEvent WebEventFactory::createWebWheelEvent(struct wpe_input_axis_event* event, float deviceScaleFactor) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 5fe064ee88198fd3c53b43366d1197d166b12a03..718bf773760a81acedb661c16401e3d211dbd2c0 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,15 @@ >+2018-09-18 Claudio Saavedra <csaavedra@igalia.com> >+ >+ [WPE] Implement mouse event modifiers >+ https://bugs.webkit.org/show_bug.cgi?id=189697 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKitTestRunner/wpe/EventSenderProxyWPE.cpp: >+ (WTR::wkEventModifiersToWPE): >+ (WTR::EventSenderProxy::mouseDown): >+ (WTR::EventSenderProxy::mouseUp): >+ > 2018-09-17 Philippe Normand <pnormand@igalia.com> > > [JHBuild] Update to GStreamer 1.14.3 >diff --git a/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp b/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp >index 92a3e44707cd5c56bed0f9aba845c872af003b72..a80d16b1a9d6a990c0aa149ac23b045ee3b15999 100644 >--- a/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp >+++ b/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp >@@ -104,6 +104,21 @@ static uint32_t modifierForButton(unsigned button) > RELEASE_ASSERT_NOT_REACHED(); > } > >+static uint32_t wkEventModifiersToWPE(WKEventModifiers wkModifiers) >+{ >+ uint32_t modifiers = 0; >+ if (wkModifiers & kWKEventModifiersShiftKey) >+ modifiers |= wpe_input_keyboard_modifier_shift; >+ if (wkModifiers & kWKEventModifiersControlKey) >+ modifiers |= wpe_input_keyboard_modifier_control; >+ if (wkModifiers & kWKEventModifiersAltKey) >+ modifiers |= wpe_input_keyboard_modifier_alt; >+ if (wkModifiers & kWKEventModifiersMetaKey) >+ modifiers |= wpe_input_keyboard_modifier_meta; >+ >+ return modifiers; >+} >+ > void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers) > { > m_clickButton = button; >@@ -113,8 +128,9 @@ void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers) > > auto wpeButton = senderButtonToWPEButton(button); > m_mouseButtonsCurrentlyDown |= modifierForButton(wpeButton); >+ uint32_t modifiers = wkEventModifiersToWPE(wkModifiers); > >- struct wpe_input_pointer_event event { wpe_input_pointer_event_type_button, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), wpeButton, m_buttonState, m_mouseButtonsCurrentlyDown }; >+ struct wpe_input_pointer_event event { wpe_input_pointer_event_type_button, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), wpeButton, m_buttonState, m_mouseButtonsCurrentlyDown | modifiers }; > wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event); > } > >@@ -125,8 +141,9 @@ void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers) > > auto wpeButton = senderButtonToWPEButton(button); > m_mouseButtonsCurrentlyDown &= ~modifierForButton(wpeButton); >+ uint32_t modifiers = wkEventModifiersToWPE(wkModifiers); > >- struct wpe_input_pointer_event event { wpe_input_pointer_event_type_button, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), wpeButton, m_buttonState, m_mouseButtonsCurrentlyDown }; >+ struct wpe_input_pointer_event event { wpe_input_pointer_event_type_button, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), wpeButton, m_buttonState, m_mouseButtonsCurrentlyDown | modifiers }; > wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event); > } > >@@ -169,21 +186,6 @@ void EventSenderProxy::leapForward(int milliseconds) > m_time += milliseconds / 1000.0; > } > >-static uint32_t wkEventModifiersToWPE(WKEventModifiers wkModifiers) >-{ >- uint32_t modifiers = 0; >- if (wkModifiers & kWKEventModifiersShiftKey) >- modifiers |= wpe_input_keyboard_modifier_shift; >- if (wkModifiers & kWKEventModifiersControlKey) >- modifiers |= wpe_input_keyboard_modifier_control; >- if (wkModifiers & kWKEventModifiersAltKey) >- modifiers |= wpe_input_keyboard_modifier_alt; >- if (wkModifiers & kWKEventModifiersMetaKey) >- modifiers |= wpe_input_keyboard_modifier_meta; >- >- return modifiers; >-} >- > static uint32_t wpeKeySymForKeyRef(WKStringRef keyRef, unsigned location, uint32_t* modifiers) > { > if (location == DOMKeyLocationNumpad) {
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 189697
: 350015