From b0864bff809913fd03ef0d035dc206690ca347fc Mon Sep 17 00:00:00 2001 From: reionwong Date: Sat, 28 Aug 2021 17:35:05 +0800 Subject: [PATCH] Reduce call grabToImage() --- qml/DockItem.qml | 2 +- src/main.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qml/DockItem.qml b/qml/DockItem.qml index 23f4228..591b5b6 100644 --- a/qml/DockItem.qml +++ b/qml/DockItem.qml @@ -117,7 +117,7 @@ Item { onPositionChanged: { if (pressed) { - if (mouse.source !== Qt.MouseEventSynthesizedByQt) { + if (control.draggable && mouse.source !== Qt.MouseEventSynthesizedByQt) { drag.target = icon icon.grabToImage(function(result) { control.Drag.imageSource = result.url diff --git a/src/main.cpp b/src/main.cpp index 9edc2f7..a62d346 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,7 +29,8 @@ int main(int argc, char *argv[]) { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); QApplication app(argc, argv); qmlRegisterType("Cutefish.Dock", 1, 0, "DockSettings");