summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2014-07-31 18:10:33 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2023-04-28 00:05:52 +0200
commitebd2fe108ae4e72d94dd7e3bc0ed296253b68b3d (patch)
treee02d5b3b432339c7c4891f6d76be92fd81d32cb1 /src
parent7b9e73a921e9ce8df1c6af2ae69a187fee06c986 (diff)
downloadqtbase-ebd2fe108ae4e72d94dd7e3bc0ed296253b68b3d.tar.gz
Add flicking behavior hints to xcb platform integration
For now these will be used in QtQuick Flickable. Task-number: QTBUG-35608 Task-number: QTBUG-35609 Task-number: QTBUG-97055 Pick-to: 6.5 Change-Id: I944d7f0271d535822ceeef610f232f56c85e0938 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 6b2a20bb30..d25b059852 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -472,21 +472,23 @@ QVariant QXcbIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
case QPlatformIntegration::StartDragVelocity:
case QPlatformIntegration::UseRtlExtensions:
case QPlatformIntegration::PasswordMaskCharacter:
+ case QPlatformIntegration::FlickMaximumVelocity:
+ case QPlatformIntegration::FlickDeceleration:
// TODO using various xcb, gnome or KDE settings
break; // Not implemented, use defaults
+ case QPlatformIntegration::FlickStartDistance:
case QPlatformIntegration::StartDragDistance: {
RETURN_VALID_XSETTINGS(xsNetDndDragThreshold);
-
// The default (in QPlatformTheme::defaultThemeHint) is 10 pixels, but
// on a high-resolution screen it makes sense to increase it.
- qreal dpi = 100.0;
+ qreal dpi = 100;
if (const QXcbScreen *screen = connection()->primaryScreen()) {
if (screen->logicalDpi().first > dpi)
dpi = screen->logicalDpi().first;
if (screen->logicalDpi().second > dpi)
dpi = screen->logicalDpi().second;
}
- return 10.0 * dpi / 100.0;
+ return (hint == QPlatformIntegration::FlickStartDistance ? qreal(15) : qreal(10)) * dpi / qreal(100);
}
case QPlatformIntegration::ShowIsFullScreen:
// X11 always has support for windows, but the