From e1070c186f2b83c5184aaa664c413e59831fb2bb Mon Sep 17 00:00:00 2001 From: gb <741021719@qq.com> Date: Thu, 25 May 2023 16:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4notifyClose=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twain/twain/huagaods.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/twain/twain/huagaods.cpp b/twain/twain/huagaods.cpp index a957529..44f93f1 100644 --- a/twain/twain/huagaods.cpp +++ b/twain/twain/huagaods.cpp @@ -3593,7 +3593,17 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc) break; case SANE_EVENT_UI_CLOSE_SETTING: scanner_->ui_hide(); - if (notify_close_ == NOTIFY_AUTO) + if (notify_close_ == NOTIFY_ALWAYS) + { + load_sane_util::to_log(1, L"close setting ui and notify close immediately.\r\n"); + rc = notifyCloseCancel(); + } + else if (notify_close_ == NOTIFY_NONE) + { + load_sane_util::to_log(1, L"close setting ui and notify close passively (wait eventProcess to do).\r\n"); + notfify_close_ = true; + } + else // if (notify_close_ == NOTIFY_AUTO) { load_sane_util::to_log(1, L"close setting ui and notify close in auto mode.\r\n"); //if (has_event_called_) @@ -3605,16 +3615,6 @@ int huagao_ds::handle_scanner_event(int ev, bool from_event_proc) notify_close_thread_->join(); notify_close_thread_.reset(new std::thread(&huagao_ds::notify_close_thread, this)); } - else if (notify_close_ == NOTIFY_ALWAYS) - { - load_sane_util::to_log(1, L"close setting ui and notify close immediately.\r\n"); - rc = notifyCloseCancel(); - } - else if (notify_close_ == NOTIFY_NONE) - { - load_sane_util::to_log(1, L"close setting ui and notify close passively (wait eventProcess to do).\r\n"); - notfify_close_ = true; - } //if(main_thread_id_ == GetCurrentThreadId()) // rc = notifyCloseCancel(); //else