diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 7867f7a1a..bf3d1cff0 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "3e3393f10c4b95f7516521c8643b9a735fd0c3f3" +#define CEF_API_HASH_UNIVERSAL "fc1554b64e963371717ccf0a2a5e686ef06dca88" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "aafe004dac5cf8b7f0b5ef12518c4a16e150f510" +#define CEF_API_HASH_PLATFORM "3df9884666f0de7427ab99cb64c85b0e303d071e" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "9cd794a0ab4506060ca2d7b3c335778d026337a4" +#define CEF_API_HASH_PLATFORM "031cd25d4dfccd19e70133c4ed0efb6b7441b503" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "fab73fe3fddb82c0f75a404fb464935592880803" +#define CEF_API_HASH_PLATFORM "9c32d35cea06c04ed0cff861ff873fea08bf5295" #endif #ifdef __cplusplus diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 7e0410129..394de0218 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -2075,6 +2075,8 @@ typedef enum { EVENTFLAG_IS_RIGHT = 1 << 11, EVENTFLAG_ALTGR_DOWN = 1 << 12, EVENTFLAG_IS_REPEAT = 1 << 13, + EVENTFLAG_PRECISION_SCROLLING_DELTA = 1 << 14, + EVENTFLAG_SCROLL_BY_PAGE = 1 << 15, } cef_event_flags_t; /// diff --git a/libcef/browser/native/browser_platform_delegate_native_aura.cc b/libcef/browser/native/browser_platform_delegate_native_aura.cc index 8ce6e5aee..6b1253987 100644 --- a/libcef/browser/native/browser_platform_delegate_native_aura.cc +++ b/libcef/browser/native/browser_platform_delegate_native_aura.cc @@ -203,8 +203,7 @@ ui::MouseWheelEvent CefBrowserPlatformDelegateNativeAura::TranslateUiWheelEvent( int changed_button_flags = TranslateUiChangedButtonFlags(mouse_event.modifiers); - return ui::MouseWheelEvent(offset, location, root_location, time_stamp, - (ui::EF_PRECISION_SCROLLING_DELTA | flags), + return ui::MouseWheelEvent(offset, location, root_location, time_stamp, flags, changed_button_flags); } @@ -266,6 +265,13 @@ int CefBrowserPlatformDelegateNativeAura::TranslateUiEventModifiers( if (cef_modifiers & EVENTFLAG_IS_REPEAT) { result |= ui::EF_IS_REPEAT; } + if (cef_modifiers & EVENTFLAG_PRECISION_SCROLLING_DELTA) { + result |= ui::EF_PRECISION_SCROLLING_DELTA; + } + if (cef_modifiers & EVENTFLAG_SCROLL_BY_PAGE) { + result |= ui::EF_SCROLL_BY_PAGE; + } + return result; } diff --git a/tests/cefclient/browser/browser_window_osr_gtk.cc b/tests/cefclient/browser/browser_window_osr_gtk.cc index 132f4fcd1..1183799c0 100644 --- a/tests/cefclient/browser/browser_window_osr_gtk.cc +++ b/tests/cefclient/browser/browser_window_osr_gtk.cc @@ -1644,6 +1644,7 @@ gint BrowserWindowOsrGtk::ScrollEvent(GtkWidget* widget, self->ApplyPopupOffset(mouse_event.x, mouse_event.y); DeviceToLogical(mouse_event, device_scale_factor); mouse_event.modifiers = GetCefStateModifiers(event->state); + mouse_event.modifiers |= EVENTFLAG_PRECISION_SCROLLING_DELTA; static const int scrollbarPixelsPerGtkTick = 40; int deltaX = 0; diff --git a/tests/cefclient/browser/osr_window_win.cc b/tests/cefclient/browser/osr_window_win.cc index 75db8fc4b..8e38a505f 100644 --- a/tests/cefclient/browser/osr_window_win.cc +++ b/tests/cefclient/browser/osr_window_win.cc @@ -743,6 +743,8 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) { ScreenToClient(hwnd_, &screen_point); int delta = GET_WHEEL_DELTA_WPARAM(wParam); + int deltaX = IsKeyDown(VK_SHIFT) ? delta : 0; + int deltaY = !IsKeyDown(VK_SHIFT) ? delta : 0; CefMouseEvent mouse_event; mouse_event.x = screen_point.x; @@ -750,9 +752,17 @@ void OsrWindowWin::OnMouseEvent(UINT message, WPARAM wParam, LPARAM lParam) { ApplyPopupOffset(mouse_event.x, mouse_event.y); DeviceToLogical(mouse_event, device_scale_factor_); mouse_event.modifiers = GetCefMouseModifiers(wParam); - browser_host->SendMouseWheelEvent(mouse_event, - IsKeyDown(VK_SHIFT) ? delta : 0, - !IsKeyDown(VK_SHIFT) ? delta : 0); + + UINT sys_info_lines; + if (SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &sys_info_lines, + 0) && + sys_info_lines == WHEEL_PAGESCROLL) { + mouse_event.modifiers |= EVENTFLAG_SCROLL_BY_PAGE; + deltaX = 0; + deltaY = (delta > 0) ? 1 : -1; + } + + browser_host->SendMouseWheelEvent(mouse_event, deltaX, deltaY); } break; }