Changeset 236124 in webkit
- Timestamp:
- Sep 18, 2018, 6:44:29 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/wpe/WebEventFactory.cpp (modified) (3 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r236102 r236124 1 2018-09-18 Claudio Saavedra <csaavedra@igalia.com> 2 3 [WPE] Implement mouse event modifiers 4 https://bugs.webkit.org/show_bug.cgi?id=189697 5 6 Reviewed by Carlos Garcia Campos. 7 8 Only "CapsLocks" is missing, as WPE doesn't support that modifier. 9 * Shared/wpe/WebEventFactory.cpp: 10 (WebKit::modifiersForEventModifiers): 11 (WebKit::WebEventFactory::createWebKeyboardEvent): 12 (WebKit::WebEventFactory::createWebMouseEvent): 13 (WebKit::modifiersForEvent): Deleted. 14 1 15 2018-09-17 Zan Dobersek <zdobersek@igalia.com> 2 16 -
trunk/Source/WebKit/Shared/wpe/WebEventFactory.cpp
r234541 r236124 39 39 } 40 40 41 static WebEvent::Modifiers modifiersForEvent (struct wpe_input_keyboard_event* event)41 static WebEvent::Modifiers modifiersForEventModifiers(unsigned eventModifiers) 42 42 { 43 43 unsigned modifiers = 0; 44 unsigned eventModifiers = event->modifiers;45 44 46 45 if (eventModifiers & wpe_input_keyboard_modifier_control) … … 78 77 event->key_code, 79 78 isWPEKeyCodeFromKeyPad(event->key_code), 80 modifiersForEvent (event),79 modifiersForEventModifiers(event->modifiers), 81 80 wallTimeForEventTime(event->time)); 82 81 } … … 138 137 unsigned clickCount = (type == WebEvent::MouseDown) ? 1 : 0; 139 138 140 // FIXME: Proper button support. Modifiers.deltaX/Y/Z. Click count.139 // FIXME: Proper button support. deltaX/Y/Z. Click count. 141 140 WebCore::IntPoint position(event->x, event->y); 142 141 position.scale(1 / deviceScaleFactor); 143 142 return WebMouseEvent(type, button, pressedMouseButtons(event->modifiers), position, position, 144 0, 0, 0, clickCount, static_cast<WebEvent::Modifiers>(0), wallTimeForEventTime(event->time));143 0, 0, 0, clickCount, modifiersForEventModifiers(event->modifiers), wallTimeForEventTime(event->time)); 145 144 } 146 145 -
trunk/Tools/ChangeLog
r236101 r236124 1 2018-09-18 Claudio Saavedra <csaavedra@igalia.com> 2 3 [WPE] Implement mouse event modifiers 4 https://bugs.webkit.org/show_bug.cgi?id=189697 5 6 Reviewed by Carlos Garcia Campos. 7 8 * WebKitTestRunner/wpe/EventSenderProxyWPE.cpp: 9 (WTR::wkEventModifiersToWPE): 10 (WTR::EventSenderProxy::mouseDown): 11 (WTR::EventSenderProxy::mouseUp): 12 1 13 2018-09-17 Yusuke Suzuki <utatane.tea@gmail.com> 2 14 -
trunk/Tools/WebKitTestRunner/wpe/EventSenderProxyWPE.cpp
r234542 r236124 105 105 } 106 106 107 void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)108 {109 m_clickButton = button;110 m_clickPosition = m_position;111 m_clickTime = m_time;112 m_buttonState = ButtonPressed;113 114 auto wpeButton = senderButtonToWPEButton(button);115 m_mouseButtonsCurrentlyDown |= modifierForButton(wpeButton);116 117 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 };118 wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);119 }120 121 void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers)122 {123 m_buttonState = ButtonReleased;124 m_clickButton = kWKEventMouseButtonNoButton;125 126 auto wpeButton = senderButtonToWPEButton(button);127 m_mouseButtonsCurrentlyDown &= ~modifierForButton(wpeButton);128 129 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 };130 wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);131 }132 133 void EventSenderProxy::mouseMoveTo(double x, double y)134 {135 m_position.x = x;136 m_position.y = y;137 138 struct wpe_input_pointer_event event { wpe_input_pointer_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), static_cast<uint32_t>(m_clickButton), m_buttonState, m_mouseButtonsCurrentlyDown };139 wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event);140 }141 142 void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)143 {144 // Copy behaviour of GTK+ - just return in case of (0,0) mouse scroll145 if (!horizontal && !vertical)146 return;147 148 if (horizontal) {149 struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), HorizontalScroll, horizontal, 0};150 wpe_view_backend_dispatch_axis_event(m_viewBackend, &event);151 }152 if (vertical) {153 struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), VerticalScroll, vertical, 0};154 wpe_view_backend_dispatch_axis_event(m_viewBackend, &event);155 }156 }157 158 void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int horizontal, int vertical, int, int)159 {160 mouseScrollBy(horizontal, vertical);161 }162 163 void EventSenderProxy::continuousMouseScrollBy(int, int, bool)164 {165 }166 167 void EventSenderProxy::leapForward(int milliseconds)168 {169 m_time += milliseconds / 1000.0;170 }171 172 107 static uint32_t wkEventModifiersToWPE(WKEventModifiers wkModifiers) 173 108 { … … 183 118 184 119 return modifiers; 120 } 121 122 void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers) 123 { 124 m_clickButton = button; 125 m_clickPosition = m_position; 126 m_clickTime = m_time; 127 m_buttonState = ButtonPressed; 128 129 auto wpeButton = senderButtonToWPEButton(button); 130 m_mouseButtonsCurrentlyDown |= modifierForButton(wpeButton); 131 uint32_t modifiers = wkEventModifiersToWPE(wkModifiers); 132 133 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 }; 134 wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event); 135 } 136 137 void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers) 138 { 139 m_buttonState = ButtonReleased; 140 m_clickButton = kWKEventMouseButtonNoButton; 141 142 auto wpeButton = senderButtonToWPEButton(button); 143 m_mouseButtonsCurrentlyDown &= ~modifierForButton(wpeButton); 144 uint32_t modifiers = wkEventModifiersToWPE(wkModifiers); 145 146 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 }; 147 wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event); 148 } 149 150 void EventSenderProxy::mouseMoveTo(double x, double y) 151 { 152 m_position.x = x; 153 m_position.y = y; 154 155 struct wpe_input_pointer_event event { wpe_input_pointer_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), static_cast<uint32_t>(m_clickButton), m_buttonState, m_mouseButtonsCurrentlyDown }; 156 wpe_view_backend_dispatch_pointer_event(m_viewBackend, &event); 157 } 158 159 void EventSenderProxy::mouseScrollBy(int horizontal, int vertical) 160 { 161 // Copy behaviour of GTK+ - just return in case of (0,0) mouse scroll 162 if (!horizontal && !vertical) 163 return; 164 165 if (horizontal) { 166 struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), HorizontalScroll, horizontal, 0}; 167 wpe_view_backend_dispatch_axis_event(m_viewBackend, &event); 168 } 169 if (vertical) { 170 struct wpe_input_axis_event event = { wpe_input_axis_event_type_motion, static_cast<uint32_t>(m_time), static_cast<int>(m_position.x), static_cast<int>(m_position.y), VerticalScroll, vertical, 0}; 171 wpe_view_backend_dispatch_axis_event(m_viewBackend, &event); 172 } 173 } 174 175 void EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases(int horizontal, int vertical, int, int) 176 { 177 mouseScrollBy(horizontal, vertical); 178 } 179 180 void EventSenderProxy::continuousMouseScrollBy(int, int, bool) 181 { 182 } 183 184 void EventSenderProxy::leapForward(int milliseconds) 185 { 186 m_time += milliseconds / 1000.0; 185 187 } 186 188
Note:
See TracChangeset
for help on using the changeset viewer.