设置界面及进度指示器父窗口如果不可见,则改为NULL为父窗口

This commit is contained in:
gb 2023-12-11 15:17:05 +08:00
parent 052135296a
commit 0eaf2a42f4
1 changed files with 6 additions and 0 deletions

View File

@ -3494,6 +3494,9 @@ COM_API_IMPLEMENT(scanner, bool, ui_show_setting(HWND parent, bool with_scan, bo
events_.clear(); events_.clear();
ui_notify = std::function<void(int, void*, int)>(); ui_notify = std::function<void(int, void*, int)>();
if (!IsWindowVisible(parent))
parent = NULL;
if (callback::show_setting_ui) if (callback::show_setting_ui)
{ {
if (with_scan) if (with_scan)
@ -3589,6 +3592,9 @@ COM_API_IMPLEMENT(scanner, bool, ui_show_progress(HWND parent, bool bIndicator))
is_bIndicator = bIndicator; is_bIndicator = bIndicator;
if (is_bIndicator) if (is_bIndicator)
ui_notify = std::function<void(int, void*, int)>(); ui_notify = std::function<void(int, void*, int)>();
if (!IsWindowVisible(parent))
parent = NULL;
auto ui_process = [this](ui_result res) auto ui_process = [this](ui_result res)
{ {
int uev = SANE_EVENT_SCAN_FINISHED; int uev = SANE_EVENT_SCAN_FINISHED;