From 673e1147531ef1be7de16714abc4b30b784469d4 Mon Sep 17 00:00:00 2001 From: Cidwel Highwind Date: Fri, 3 Apr 2026 20:46:15 +0200 Subject: [PATCH] Prevent preview window repositioning on file/preset changes - Remove all automatic preview window close+reopen on file change - Remove preview reopen from preset New/Clone/Rename/Delete actions - Preview title may be stale after preset change but window stays in place - User can press Fit to update title when desired --- aniphallow.lua | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/aniphallow.lua b/aniphallow.lua index 995562b..35db0ee 100644 --- a/aniphallow.lua +++ b/aniphallow.lua @@ -1496,14 +1496,11 @@ openPreviewWindow = function() if presetForFile ~= S.currentPreset then loadPreset(presetForFile) S.currentPreset = presetForFile - -- Refresh UI if main dialog is open + -- Refresh UI if main dialog is open (don't touch preview - avoids repositioning) if mainDlg then pcall(function() mainDlg:close() end) openMainDialog() end - -- Reopen preview to update title - pcall(function() previewDlg:close() end) - openPreviewWindow() end end end @@ -1664,11 +1661,7 @@ openMainDialog = function() d:close() if mainDlg then pcall(function() mainDlg:close() end) end openMainDialog() - -- Reopen preview to update title - if previewDlg then - pcall(function() previewDlg:close() end) - openPreviewWindow() - end + -- Preview title will be stale but avoids repositioning window end end } d:button{ id = "presetClone", text = "Clone", onclick = function() @@ -1699,11 +1692,7 @@ openMainDialog = function() d:close() if mainDlg then pcall(function() mainDlg:close() end) end openMainDialog() - -- Reopen preview to update title - if previewDlg then - pcall(function() previewDlg:close() end) - openPreviewWindow() - end + -- Preview title will be stale but avoids repositioning window end end } d:button{ id = "presetRename", text = "Rename", onclick = function() @@ -1748,11 +1737,7 @@ openMainDialog = function() d:close() if mainDlg then pcall(function() mainDlg:close() end) end openMainDialog() - -- Reopen preview to update title - if previewDlg then - pcall(function() previewDlg:close() end) - openPreviewWindow() - end + -- Preview title will be stale but avoids repositioning window end end } d:button{ id = "presetDelete", text = "Delete", onclick = function() @@ -1871,11 +1856,7 @@ openMainDialog = function() if presetChanged then dlg:close() openMainDialog() - -- Reopen preview to update title - if previewDlg then - pcall(function() previewDlg:close() end) - openPreviewWindow() - end + -- Preview title will be stale but avoids repositioning window return end dlg:repaint() @@ -3257,11 +3238,6 @@ openMainDialog = function() S.currentPreset = presetForFile pcall(function() dlg:close() end) openMainDialog() - -- Reopen preview to update title - if previewDlg then - pcall(function() previewDlg:close() end) - openPreviewWindow() - end end end end