From d61c376800c017182977dbd5c44ebd952bcdcb34 Mon Sep 17 00:00:00 2001 From: Wang Yu Date: Thu, 23 Apr 2026 20:49:39 +0800 Subject: [PATCH] fix(window): prevent window re-centering on image switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove window centering from onCurrentSourceChanged to keep window position during image browsing. Center only once on startup. 移除 onCurrentSourceChanged 中的窗口居中逻辑,仅在程序首次 启动时居中窗口,切换和打开图片时保持用户摆放的位置。 Log: 修复切换图片时窗口位置重置到居中的问题 PMS: BUG-358647 Influence: 移动窗口后切换或打开图片不再跳回屏幕居中,仅在首次启动时居中。 --- src/qml/main.qml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/qml/main.qml b/src/qml/main.qml index 792f2ecd..839d6da3 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 - 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -65,10 +65,6 @@ ApplicationWindow { Connections { function onCurrentSourceChanged() { window.title = IV.FileControl.slotGetFileName(IV.GControl.currentSource) + IV.FileControl.slotFileSuffix(IV.GControl.currentSource); - if (window.visibility !== Window.FullScreen && window.visibility !== Window.Maximized) { - setX(IV.FileControl.getPrimaryScreenCenterX(width)); - setY(IV.FileControl.getPrimaryScreenCenterY(height)); - } } target: IV.GControl