Skip to content

fix(trayicon): explorer.exe hangs#1522

Closed
wzv5 wants to merge 1 commit intorime:masterfrom
wzv5:patch-1
Closed

fix(trayicon): explorer.exe hangs#1522
wzv5 wants to merge 1 commit intorime:masterfrom
wzv5:patch-1

Conversation

@wzv5
Copy link
Copy Markdown
Contributor

@wzv5 wzv5 commented Mar 1, 2025

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

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

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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor

fxliang commented Mar 26, 2025

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

@fxliang fxliang mentioned this pull request May 16, 2025
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