From 2fbdb633e16857a58e883f0ecf2bfdcc308d36bb Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Wed, 3 Jan 2024 12:23:40 +0100 Subject: [PATCH 1/3] qt6.6 scroll issues CURA-11468 --- conanfile.py | 1 + cura_app.py | 1 + packaging/AppImage-builder/AppImageBuilder.yml.jinja | 1 + packaging/AppImage/AppRun | 1 + 4 files changed, 4 insertions(+) diff --git a/conanfile.py b/conanfile.py index a3ca8f1c89..5ebcf5a4c4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -71,6 +71,7 @@ class CuraConan(ConanFile): self._cura_env = Environment() self._cura_env.define("QML2_IMPORT_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "qml"))) self._cura_env.define("QT_PLUGIN_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "plugins"))) + self._cura_env.define("QT_QUICK_FLICKABLE_WHEEL_DECELERATION", "5000") if not self.in_local_cache: self._cura_env.define("CURA_DATA_ROOT", str(self._share_dir.joinpath("cura"))) diff --git a/cura_app.py b/cura_app.py index 905d8f4ee0..17321b8042 100755 --- a/cura_app.py +++ b/cura_app.py @@ -17,6 +17,7 @@ import faulthandler import os if sys.platform != "linux": # Turns out the Linux build _does_ use this, but we're not making an Enterprise release for that system anyway. os.environ["QT_PLUGIN_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. + os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. os.environ["QML2_IMPORT_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. os.environ["QT_OPENGL_DLL"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. diff --git a/packaging/AppImage-builder/AppImageBuilder.yml.jinja b/packaging/AppImage-builder/AppImageBuilder.yml.jinja index 9090a5f209..ae6cabcaa1 100644 --- a/packaging/AppImage-builder/AppImageBuilder.yml.jinja +++ b/packaging/AppImage-builder/AppImageBuilder.yml.jinja @@ -45,6 +45,7 @@ AppDir: LD_LIBRARY_PATH: "$APPDIR:$APPDIR/runtime/compat/:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders" PYTHONPATH: "$APPDIR" QT_PLUGIN_PATH: "$APPDIR/qt/plugins" + QT_QUICK_FLICKABLE_WHEEL_DECELERATION: "5000" QML2_IMPORT_PATH: "$APPDIR/qt/qml" QT_QPA_PLATFORMTHEME: xdgdesktopportal GDK_PIXBUF_MODULEDIR: $APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders diff --git a/packaging/AppImage/AppRun b/packaging/AppImage/AppRun index 369ce54c6c..9926df1878 100644 --- a/packaging/AppImage/AppRun +++ b/packaging/AppImage/AppRun @@ -5,6 +5,7 @@ scriptdir=$(dirname $0) export PYTHONPATH="$scriptdir/lib/python3.10" export LD_LIBRARY_PATH=$scriptdir export QT_PLUGIN_PATH="$scriptdir/qt/plugins" +export QT_QUICK_FLICKABLE_WHEEL_DECELERATION="5000" export QML2_IMPORT_PATH="$scriptdir/qt/qml" export QT_QPA_FONTDIR=/usr/share/fonts export QT_QPA_PLATFORMTHEME=xdgdesktopportal From 1747bbb0cbc28e7eef2736af9cb75a58af67a776 Mon Sep 17 00:00:00 2001 From: Saumya Jain <70144862+saumyaj3@users.noreply.github.com> Date: Thu, 4 Jan 2024 14:18:57 +0100 Subject: [PATCH 2/3] Update cura_app.py sanitization of environment variable Co-authored-by: Casper Lamboo --- cura_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index 17321b8042..7e80bbac79 100755 --- a/cura_app.py +++ b/cura_app.py @@ -17,7 +17,11 @@ import faulthandler import os if sys.platform != "linux": # Turns out the Linux build _does_ use this, but we're not making an Enterprise release for that system anyway. os.environ["QT_PLUGIN_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. - os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. + try: + # try converting to integer + os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = str(int(os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"])) + except ValueError: + os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = "5000" os.environ["QML2_IMPORT_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. os.environ["QT_OPENGL_DLL"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. From bb0c17b2fd5c30cb912d5768c010f27309f6f83c Mon Sep 17 00:00:00 2001 From: HellAholic Date: Wed, 10 Jan 2024 15:41:20 +0100 Subject: [PATCH 3/3] Revert "qt6.6 scroll issues" --- conanfile.py | 1 - cura_app.py | 5 ----- packaging/AppImage-builder/AppImageBuilder.yml.jinja | 1 - packaging/AppImage/AppRun | 1 - 4 files changed, 8 deletions(-) diff --git a/conanfile.py b/conanfile.py index 5ebcf5a4c4..a3ca8f1c89 100644 --- a/conanfile.py +++ b/conanfile.py @@ -71,7 +71,6 @@ class CuraConan(ConanFile): self._cura_env = Environment() self._cura_env.define("QML2_IMPORT_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "qml"))) self._cura_env.define("QT_PLUGIN_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "plugins"))) - self._cura_env.define("QT_QUICK_FLICKABLE_WHEEL_DECELERATION", "5000") if not self.in_local_cache: self._cura_env.define("CURA_DATA_ROOT", str(self._share_dir.joinpath("cura"))) diff --git a/cura_app.py b/cura_app.py index 7e80bbac79..905d8f4ee0 100755 --- a/cura_app.py +++ b/cura_app.py @@ -17,11 +17,6 @@ import faulthandler import os if sys.platform != "linux": # Turns out the Linux build _does_ use this, but we're not making an Enterprise release for that system anyway. os.environ["QT_PLUGIN_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. - try: - # try converting to integer - os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = str(int(os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"])) - except ValueError: - os.environ["QT_QUICK_FLICKABLE_WHEEL_DECELERATION"] = "5000" os.environ["QML2_IMPORT_PATH"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. os.environ["QT_OPENGL_DLL"] = "" # Security workaround: Don't need it, and introduces an attack vector, so set to nul. diff --git a/packaging/AppImage-builder/AppImageBuilder.yml.jinja b/packaging/AppImage-builder/AppImageBuilder.yml.jinja index ae6cabcaa1..9090a5f209 100644 --- a/packaging/AppImage-builder/AppImageBuilder.yml.jinja +++ b/packaging/AppImage-builder/AppImageBuilder.yml.jinja @@ -45,7 +45,6 @@ AppDir: LD_LIBRARY_PATH: "$APPDIR:$APPDIR/runtime/compat/:$APPDIR/usr/lib/x86_64-linux-gnu:$APPDIR/lib/x86_64-linux-gnu:$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders" PYTHONPATH: "$APPDIR" QT_PLUGIN_PATH: "$APPDIR/qt/plugins" - QT_QUICK_FLICKABLE_WHEEL_DECELERATION: "5000" QML2_IMPORT_PATH: "$APPDIR/qt/qml" QT_QPA_PLATFORMTHEME: xdgdesktopportal GDK_PIXBUF_MODULEDIR: $APPDIR/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders diff --git a/packaging/AppImage/AppRun b/packaging/AppImage/AppRun index 9926df1878..369ce54c6c 100644 --- a/packaging/AppImage/AppRun +++ b/packaging/AppImage/AppRun @@ -5,7 +5,6 @@ scriptdir=$(dirname $0) export PYTHONPATH="$scriptdir/lib/python3.10" export LD_LIBRARY_PATH=$scriptdir export QT_PLUGIN_PATH="$scriptdir/qt/plugins" -export QT_QUICK_FLICKABLE_WHEEL_DECELERATION="5000" export QML2_IMPORT_PATH="$scriptdir/qt/qml" export QT_QPA_FONTDIR=/usr/share/fonts export QT_QPA_PLATFORMTHEME=xdgdesktopportal