Skip to content

fix(trayicon): explorer.exe hangs #1522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix(trayicon): explorer.exe hangs #1522

wants to merge 1 commit into from

Conversation

wzv5
Copy link
Contributor

@wzv5 wzv5 commented Mar 1, 2025

应该可以修复托盘图标卡死 explorer.exe,其实是卡住 7 秒。

我这里测试是不卡了,还需要更多测试。

@@ -116,7 +116,7 @@ void _RefreshTrayIcon(const RimeSessionId session_id,
static char app_name[50];
rime_api->get_property(session_id, "client_app", app_name,
sizeof(app_name) - 1);
if (u8tow(app_name) == std::wstring(L"explorer.exe"))
if (u8tow(app_name) == std::wstring(L"explorer.exe") || !app_name[0])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!app_name[0] 竟有這種情況,那是不是應該先測非空再轉碼、比較?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实应该先测非空。
但为啥为空我还没找出来,这段时间都没空调试,也许应该先找找为空的原因,从根源上解决。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空的上一步,可能是RimeWithWeaselHandler::_ReadClientInfo中有

  if (!app_name.empty()) {
    rime_api->set_property(session_id, "client_app", app_name.c_str());

然后 get_property其实是个Bool返回的接口,应该将这个返回用起来这样

@fxliang
Copy link
Contributor

fxliang commented Mar 26, 2025

如果这个有效,那很可能会关闭 #938

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants