Skip to content

Commit 5635b27

Browse files
committed
Save on deactivate #164: prevent execution of FileSave() when window is closed/hidden
1 parent 7e30edf commit 5635b27

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

bin/Notepad2e.exe

0 Bytes
Binary file not shown.

src/Notepad2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ LRESULT CALLBACK MainWndProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
866866
n2e_SelectionEditStop(SES_APPLY);
867867
// [2e]: Save on deactivate #164
868868
static BOOL bSaveInProgress = FALSE;
869-
if ((iSaveOnLoseFocus != SLF_DISABLED) && !bSaveInProgress)
869+
if ((iSaveOnLoseFocus != SLF_DISABLED) && !bSaveInProgress && IsWindowVisible(hwnd))
870870
{
871871
bSaveInProgress = TRUE;
872872
FileSave(TRUE, FALSE, FALSE, FALSE, FALSE);

0 commit comments

Comments
 (0)