diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2014-07-31 18:10:33 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-04-27 22:06:03 +0000 |
commit | d332c6fd911122cf0d44a21268f2e57305512deb (patch) | |
tree | bd49caa45c04df2dda8490dba9fbe0c3d412f93a | |
parent | 6b603e695f49c80fe331b26db2ba568b43d0f5fa (diff) | |
download | qtbase-d332c6fd911122cf0d44a21268f2e57305512deb.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
Change-Id: I944d7f0271d535822ceeef610f232f56c85e0938
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ebd2fe108ae4e72d94dd7e3bc0ed296253b68b3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 8 |
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 |