From 1c4a2699d59dbb5c347b65dee86cee3bb61763ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Fri, 24 Feb 2023 15:38:44 +0100 Subject: [PATCH] Reduced lag when hardware acceleration is turned on This essentially disabled vsync, though with composited window managers there should not be visible tearing anyway. It does seem to affect animation timing as well though, which affects scrolling with arrow keys. Related to issue #3584 --- src/tiledapp/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/tiledapp/main.cpp b/src/tiledapp/main.cpp index 8ec5c5d2f9..198f029114 100644 --- a/src/tiledapp/main.cpp +++ b/src/tiledapp/main.cpp @@ -22,16 +22,15 @@ #include "commandlineparser.h" #include "exporthelper.h" -#include "languagemanager.h" #include "logginginterface.h" #include "mainwindow.h" -#include "mapdocument.h" #include "mapformat.h" -#include "mapreader.h" #include "pluginmanager.h" #include "preferences.h" #include "scriptmanager.h" +#ifdef TILED_SENTRY #include "sentryhelper.h" +#endif #include "tiledapplication.h" #include "tileset.h" #include "tmxmapformat.h" @@ -40,6 +39,7 @@ #include #include #include +#include #include #include "qtcompat_p.h" @@ -571,6 +571,11 @@ int main(int argc, char *argv[]) Session::initialize(); + // Disable vsync to make hardware accelerated mode more responsive + QSurfaceFormat format; + format.setSwapInterval(0); + QSurfaceFormat::setDefaultFormat(format); + MainWindow w; w.show();