Changeset 199810 in webkit
- Timestamp:
- Apr 21, 2016 3:50:59 AM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r199795 r199810 1 2016-04-21 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] WebKitWebView should propagate wheel events not handled by the web process 4 https://bugs.webkit.org/show_bug.cgi?id=156834 5 6 Reviewed by Žan Doberšek. 7 8 We are currently swallowing all wheel events unconditionally, not allowing applications to handle wheel events 9 when not handled by us. Since the GTK+ event propagation system is synchronous, and our events are handled 10 asynchronously, we need to do something similar to what we do for key events, not propagate the event the first 11 time and if not handled by the web process, re-inject it in the event loop and then just propagate it. 12 13 * Shared/NativeWebWheelEvent.h: 14 (WebKit::NativeWebWheelEvent::nativeEvent): Remove useless const. 15 * UIProcess/API/gtk/PageClientImpl.cpp: 16 (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Tell the web view to propagate the next wheel event, 17 and re-inject the event not handled by the web process in the event loop. 18 * UIProcess/API/gtk/PageClientImpl.h: 19 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 20 (webkitWebViewBaseScrollEvent): Propagate the event if shouldForwardNextWheelEvent is true. 21 (webkitWebViewBaseForwardNextWheelEvent): Set shouldForwardNextWheelEvent to true. 22 * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: 23 * UIProcess/PageClient.h: 24 * UIProcess/WebPageProxy.cpp: 25 (WebKit::WebPageProxy::didReceiveEvent): Remove ifdef. 26 * UIProcess/efl/WebView.h: 27 1 28 2016-04-20 Dustin Falgout <dustin@falgout.us> 2 29 -
trunk/Source/WebKit2/Shared/NativeWebWheelEvent.h
r163886 r199810 60 60 NSEvent* nativeEvent() const { return m_nativeEvent.get(); } 61 61 #elif PLATFORM(GTK) 62 constGdkEvent* nativeEvent() const { return m_nativeEvent.get(); }62 GdkEvent* nativeEvent() const { return m_nativeEvent.get(); } 63 63 #elif PLATFORM(EFL) 64 64 const Evas_Event_Mouse_Wheel* nativeEvent() const { return m_nativeEvent; } -
trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
r198775 r199810 32 32 #include "NativeWebKeyboardEvent.h" 33 33 #include "NativeWebMouseEvent.h" 34 #include "NativeWebWheelEvent.h" 34 35 #include "NotImplemented.h" 35 36 #include "WebColorPickerGtk.h" … … 378 379 #endif // ENABLE(TOUCH_EVENTS) 379 380 381 void PageClientImpl::wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent& event) 382 { 383 webkitWebViewBaseForwardNextWheelEvent(WEBKIT_WEB_VIEW_BASE(m_viewWidget)); 384 gtk_main_do_event(event.nativeEvent()); 385 } 386 380 387 void PageClientImpl::didFinishLoadingDataForCustomContentProvider(const String&, const IPC::DataReference&) 381 388 { -
trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
r199695 r199810 132 132 #endif 133 133 134 void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override; 135 134 136 void didChangeBackgroundColor() override; 135 137 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r197733 r199810 178 178 RefPtr<WebPageProxy> pageProxy; 179 179 bool shouldForwardNextKeyEvent; 180 bool shouldForwardNextWheelEvent; 180 181 ClickCounter clickCounter; 181 182 CString tooltipText; … … 854 855 WebKitWebViewBasePrivate* priv = webViewBase->priv; 855 856 857 if (std::exchange(priv->shouldForwardNextWheelEvent, false)) 858 return FALSE; 859 856 860 if (priv->authenticationDialog) 857 return TRUE;861 return FALSE; 858 862 859 863 priv->pageProxy->handleWheelEvent(NativeWebWheelEvent(reinterpret_cast<GdkEvent*>(event))); … … 1284 1288 } 1285 1289 1290 void webkitWebViewBaseForwardNextWheelEvent(WebKitWebViewBase* webkitWebViewBase) 1291 { 1292 webkitWebViewBase->priv->shouldForwardNextWheelEvent = true; 1293 } 1294 1286 1295 #if ENABLE(FULLSCREEN_API) 1287 1296 static void screenSaverInhibitedCallback(GDBusProxy* screenSaverProxy, GAsyncResult* result, WebKitWebViewBase* webViewBase) -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h
r196062 r199810 45 45 void webkitWebViewBaseSetTooltipArea(WebKitWebViewBase*, const WebCore::IntRect&); 46 46 void webkitWebViewBaseForwardNextKeyEvent(WebKitWebViewBase*); 47 void webkitWebViewBaseForwardNextWheelEvent(WebKitWebViewBase*); 47 48 void webkitWebViewBaseChildMoveResize(WebKitWebViewBase*, GtkWidget*, const WebCore::IntRect&); 48 49 void webkitWebViewBaseEnterFullScreen(WebKitWebViewBase*); -
trunk/Source/WebKit2/UIProcess/PageClient.h
r199695 r199810 169 169 virtual bool canUndoRedo(WebPageProxy::UndoOrRedo) = 0; 170 170 virtual void executeUndoRedo(WebPageProxy::UndoOrRedo) = 0; 171 virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) = 0; 171 172 #if PLATFORM(COCOA) 172 173 virtual void accessibilityWebProcessTokenReceived(const IPC::DataReference&) = 0; … … 180 181 virtual LayerOrView *acceleratedCompositingRootLayer() const = 0; 181 182 virtual PassRefPtr<ViewSnapshot> takeViewSnapshot() = 0; 182 virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) = 0;183 183 #if ENABLE(MAC_GESTURE_EVENTS) 184 184 virtual void gestureEventWasNotHandledByWebCore(const NativeWebGestureEvent&) = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r199695 r199810 4647 4647 if (m_uiClient->implementsDidNotHandleWheelEvent()) 4648 4648 m_uiClient->didNotHandleWheelEvent(this, oldestCoalescedEvent->last()); 4649 #if PLATFORM(COCOA)4650 4649 m_pageClient.wheelEventWasNotHandledByWebCore(oldestCoalescedEvent->last()); 4651 #endif4652 4650 } 4653 4651 -
trunk/Source/WebKit2/UIProcess/efl/WebView.h
r199695 r199810 208 208 void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) override; 209 209 #endif 210 void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override { } 210 211 211 212 RefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy&) override;
Note: See TracChangeset
for help on using the changeset viewer.