From 14cc9ef2d98d2045747c17f14662a26db14d0aee Mon Sep 17 00:00:00 2001 From: lynnux Date: Wed, 17 Aug 2022 09:43:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0tid=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gui.rs | 4 ++++ src/transparent.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/src/gui.rs b/src/gui.rs index 87a4e28..fad309b 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -3,6 +3,8 @@ use std::rc::Rc; use winapi::shared::minwindef::*; use winapi::um::processthreadsapi::*; use winapi::um::winuser::*; +use crate::transparent::debug_output; +use crate::to_wstring; // hotkey参考 https://blog.csdn.net/x356982611/article/details/16341797 static mut HACCEL: usize = 0; @@ -12,6 +14,8 @@ pub fn popup( pop_list: Vec, to_sel: usize, ) -> Option { + // 确认不是emacs gui线程,所以头次运行经常会失去焦点 + // debug_output!(format!("popup tid: {}", winapi::um::processthreadsapi::GetCurrentThreadId())); if unsafe { HACCEL == 0 } { unsafe { HACCEL = diff --git a/src/transparent.rs b/src/transparent.rs index 5c69462..a6071f8 100644 --- a/src/transparent.rs +++ b/src/transparent.rs @@ -39,6 +39,7 @@ macro_rules! debug_output { } }; } +pub(crate) use debug_output; // 这样其它mod才能用 // https://github.com/duilib/duilib/blob/bbc817e0a134cda1dc5be6a38864257649273095/DuiLib/Utils/WndShadow.cpp#L197-L307 // msdn: https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features