Changeset 269143 in webkit
- Timestamp:
- Oct 29, 2020, 4:23:45 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 deleted
- 8 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/SourcesGTK.txt (modified) (1 diff)
-
WebCore/platform/PlatformWheelEvent.h (modified) (3 diffs)
-
WebCore/platform/ScrollAnimator.cpp (modified) (3 diffs)
-
WebCore/platform/ScrollAnimator.h (modified) (1 diff)
-
WebCore/platform/gtk/GtkVersioning.h (modified) (1 diff)
-
WebCore/platform/gtk/PlatformWheelEventGtk.cpp (deleted)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/gtk/WebEventFactory.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269141 r269143 1 2020-10-29 Chris Lord <clord@igalia.com> 2 3 [GTK] Smooth scrolling should not apply to continuous scrolling with sync scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=218133 5 6 Reviewed by Adrian Perez de Castro. 7 8 Respect PlatformWheelEvent.hasPreciseScrollingDeltas in the base 9 ScrollAnimator class, and make sure the flag is set correctly for 10 GdkEvent. 11 12 * SourcesGTK.txt: 13 * platform/PlatformWheelEvent.h: 14 (WebCore::PlatformWheelEvent::setHasPreciseScrollingDeltas): 15 * platform/ScrollAnimator.cpp: 16 (WebCore::ScrollAnimator::scroll): 17 (WebCore::ScrollAnimator::scrollWithoutAnimation): 18 (WebCore::ScrollAnimator::handleWheelEvent): 19 * platform/ScrollAnimator.h: 20 * platform/gtk/GtkVersioning.h: 21 (gdk_event_get_source_device): 22 * platform/gtk/PlatformWheelEventGtk.cpp: Removed. 23 1 24 2020-10-29 Cathie Chen <cathiechen@igalia.com> 2 25 -
trunk/Source/WebCore/SourcesGTK.txt
r266055 r269143 113 113 platform/gtk/PlatformKeyboardEventGtk.cpp 114 114 platform/gtk/PlatformScreenGtk.cpp 115 platform/gtk/PlatformWheelEventGtk.cpp116 115 platform/gtk/RenderThemeGadget.cpp 117 116 platform/gtk/RenderThemeScrollbar.cpp -
trunk/Source/WebCore/platform/PlatformWheelEvent.h
r268522 r269143 31 31 #include <wtf/WindowsExtras.h> 32 32 33 #if PLATFORM(GTK)34 typedef struct _GdkEventScroll GdkEventScroll;35 #endif36 37 33 namespace WTF { 38 34 class TextStream; … … 138 134 const FloatSize& scrollingVelocity() const { return m_scrollingVelocity; } 139 135 140 #if PLATFORM(GTK)141 explicit PlatformWheelEvent(GdkEventScroll*);142 #endif143 144 #if PLATFORM(COCOA) || PLATFORM(GTK) || USE(LIBWPE)145 136 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; } 146 137 void setHasPreciseScrollingDeltas(bool hasPreciseScrollingDeltas) { m_hasPreciseScrollingDeltas = hasPreciseScrollingDeltas; } 147 #endif148 138 149 139 #if PLATFORM(COCOA) … … 197 187 PlatformWheelEventPhase m_momentumPhase { PlatformWheelEventPhaseNone }; 198 188 #endif 199 #if PLATFORM(COCOA) || PLATFORM(GTK) || USE(LIBWPE)200 189 bool m_hasPreciseScrollingDeltas { false }; 201 #endif202 190 #if PLATFORM(COCOA) 203 191 unsigned m_scrollCount { 0 }; -
trunk/Source/WebCore/platform/ScrollAnimator.cpp
r268031 r269143 81 81 } 82 82 83 bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier) 83 bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier) 84 { 85 return scrollWithoutAnimation(orientation, granularity, step, multiplier); 86 } 87 88 bool ScrollAnimator::scrollWithoutAnimation(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier) 84 89 { 85 90 FloatPoint currentPosition = this->currentPosition(); … … 177 182 deltaY = -deltaY; 178 183 } 179 scroll(VerticalScrollbar, granularity, verticalScrollbar->pixelStep(), -deltaY); 184 if (e.hasPreciseScrollingDeltas()) 185 scrollWithoutAnimation(VerticalScrollbar, granularity, verticalScrollbar->pixelStep(), -deltaY); 186 else 187 scroll(VerticalScrollbar, granularity, verticalScrollbar->pixelStep(), -deltaY); 180 188 } 181 189 … … 187 195 deltaX = -deltaX; 188 196 } 189 scroll(HorizontalScrollbar, granularity, horizontalScrollbar->pixelStep(), -deltaX); 197 if (e.hasPreciseScrollingDeltas()) 198 scrollWithoutAnimation(HorizontalScrollbar, granularity, horizontalScrollbar->pixelStep(), -deltaX); 199 else 200 scroll(HorizontalScrollbar, granularity, horizontalScrollbar->pixelStep(), -deltaX); 190 201 } 191 202 } -
trunk/Source/WebCore/platform/ScrollAnimator.h
r268031 r269143 73 73 // The base class implementation always scrolls immediately, never animates. 74 74 virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier); 75 bool scrollWithoutAnimation(ScrollbarOrientation, ScrollGranularity, float step, float multiplier); 75 76 76 77 void scrollToOffset(const FloatPoint&); -
trunk/Source/WebCore/platform/gtk/GtkVersioning.h
r263843 r269143 81 81 } 82 82 83 static inline GdkDevice* 84 gdk_event_get_source_device(const GdkEvent* event) 85 { 86 return gdk_event_get_device(event); 87 } 88 83 89 static inline void 84 90 gtk_widget_size_allocate(GtkWidget* widget, GtkAllocation* allocation) -
trunk/Source/WebKit/ChangeLog
r269129 r269143 1 2020-10-29 Chris Lord <clord@igalia.com> 2 3 [GTK] Smooth scrolling should not apply to continuous scrolling with sync scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=218133 5 6 Reviewed by Adrian Perez de Castro. 7 8 Set hasPreciseScrollDeltas appropriately on scroll events created from GdkEvent. 9 10 * Shared/gtk/WebEventFactory.cpp: 11 (WebKit::WebEventFactory::createWebWheelEvent): 12 1 13 2020-10-28 John Wilander <wilander@apple.com> 2 14 -
trunk/Source/WebKit/Shared/gtk/WebEventFactory.cpp
r268522 r269143 281 281 FloatSize delta(wheelTicks.width() * step, wheelTicks.height() * step); 282 282 283 bool hasPreciseScrollingDeltas = false; 284 GdkScrollDirection direction; 285 if (!gdk_event_get_scroll_direction(event, &direction)) { 286 double deltaX, deltaY; 287 if (gdk_event_get_scroll_deltas(event, &deltaX, &deltaY)) { 288 if (auto* device = gdk_event_get_source_device(event)) 289 hasPreciseScrollingDeltas = gdk_device_get_source(device) != GDK_SOURCE_MOUSE; 290 } 291 } 292 283 293 return WebWheelEvent(WebEvent::Wheel, 284 294 position, … … 289 299 momentumPhase, 290 300 WebWheelEvent::ScrollByPixelWheelEvent, 291 false,301 hasPreciseScrollingDeltas, 292 302 modifiersForEvent(event), 293 303 wallTimeForEvent(event));
Note:
See TracChangeset
for help on using the changeset viewer.