From 8ea6e8d525b9dd8703ebdd0938706bd9785858a4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 25 Jul 2016 08:57:47 +0200 Subject: QWindowsTheme::themeHint(): Handle special value of SPI_GETWHEELSCROLLLINES When the mouse wheel step is set to "Scroll one screen", querying SPI_GETWHEELSCROLLLINES returns the special value unsigned(-1). Return the default instead of converting it to int in that case since Qt does not implement it. Task-number: QTBUG-52384 Change-Id: I793e5c09103fe0c7c4a378aba97e9f63ae1c2f35 Reviewed-by: Giuseppe D'Angelo Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowstheme.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowstheme.cpp') diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index ce0c69f9ed..40be4fa31f 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -401,8 +401,13 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const return QVariant(booleanSystemParametersInfo(SPI_GETSNAPTODEFBUTTON, false)); case ContextMenuOnMouseRelease: return QVariant(true); - case WheelScrollLines: - return QVariant(int(dWordSystemParametersInfo(SPI_GETWHEELSCROLLLINES, 3))); + case WheelScrollLines: { + int result = 3; + const DWORD scrollLines = dWordSystemParametersInfo(SPI_GETWHEELSCROLLLINES, DWORD(result)); + if (scrollLines != DWORD(-1)) // Special value meaning "scroll one screen", unimplemented in Qt. + result = int(scrollLines); + return QVariant(result); + } default: break; } -- cgit v1.2.3