From 08ebc678e5637b22e07d7fa195c3a8d706b0de9e Mon Sep 17 00:00:00 2001 From: anders_k Date: Tue, 11 Oct 2016 19:47:21 +0000 Subject: [PATCH] LockWindow Off should always enable painting git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6789 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 2 +- Source/exehead/exec.c | 8 ++++---- Source/script.cpp | 5 +---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 5a021041..c5d24c18 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -637,7 +637,7 @@ skipPage: if (!ui_dlg_visible && m_curwnd) { - ShowWindow(hwndDlg, SW_SHOWDEFAULT); + ShowWindow(hwndDlg, SW_SHOWDEFAULT); // BUGBUG: Why is this here, it does not seem to be required? ui_dlg_visible = 1; } diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index a30e345a..1bac4222 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -1702,10 +1702,10 @@ static int NSISCALL ExecuteEntry(entry *entry_) #ifdef NSIS_LOCKWINDOW_SUPPORT case EW_LOCKWINDOW: { - // ui_dlg_visible is 1 or 0, so is parm0 - SendMessage(g_hwnd, WM_SETREDRAW, parm0 & ui_dlg_visible, 0); - if ( parm0 ) - InvalidateRect(g_hwnd, NULL, FALSE); + // Not using ui_dlg_visible because it is not always in sync and we don't want to risk not painting. + // See http://forums.winamp.com/showthread.php?t=397781 for details. + SendMessage(g_hwnd, WM_SETREDRAW, parm0, 0); + if (parm0) InvalidateRect(g_hwnd, NULL, FALSE); break; } #endif //NSIS_LOCKWINDOW_SUPPORT diff --git a/Source/script.cpp b/Source/script.cpp index bb390bc0..ed8dda04 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -6297,9 +6297,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) case TOK_PLUGINDIR: case TOK__PLUGINCOMMAND: case TOK_INITPLUGINSDIR: - { ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_PLUGIN_SUPPORT not defined.\n"),line.gettoken_str(0)); - } return PS_ERROR; #endif// NSIS_CONFIG_PLUGIN_SUPPORT @@ -6308,8 +6306,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) SCRIPT_MSG(_T("LockWindow: lock state=%d\n"),line.gettoken_str(1)); ent.which=EW_LOCKWINDOW; ent.offsets[0]=line.gettoken_enum(1,_T("on\0off\0")); - if (ent.offsets[0] == -1) - PRINTHELP(); + if (ent.offsets[0] == -1) PRINTHELP(); return add_entry(&ent); #else case TOK_LOCKWINDOW: