Repository navigation
Win10 IME tray icon fix - #7447
Conversation
|
Thanks for the pull request! This repository uses a two-stage review: an AI review that you run yourself, followed by a human review. To get started, comment See the pull request review process for the full details. |
|
/ai-review |
|
@yumeyao |
Submission reviewNote: This review was done by Claude. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Remember: The AI reviewer can be wrong - it may misread code, flag correct code as broken, or suggest changes that make things worse. Treat its findings as suggestions to verify, not instructions to follow blindly. You're responsible for the code you submit, so if a finding doesn't hold up, say so instead of changing working code to satisfy it. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. The approach is targeted: it subclasses only the tray children it moves and overrides only the indicator's size reply. But the mod won't take effect in the most common case, and a few details need fixing: 1. The mod does nothing after a reboot or an Explorer restart. Fix: also catch the tray windows when they're created, and keep the current lookup for enabling mid-session. Hook using CreateWindowExW_t = decltype(&CreateWindowExW);
CreateWindowExW_t CreateWindowExW_Original;
HWND WINAPI CreateWindowExW_Hook(DWORD dwExStyle, LPCWSTR lpClassName,
LPCWSTR lpWindowName, DWORD dwStyle, int X,
int Y, int nWidth, int nHeight,
HWND hWndParent, HMENU hMenu,
HINSTANCE hInstance, LPVOID lpParam) {
HWND hWnd = CreateWindowExW_Original(dwExStyle, lpClassName, lpWindowName,
dwStyle, X, Y, nWidth, nHeight,
hWndParent, hMenu, hInstance, lpParam);
if (hWnd && !IS_INTRESOURCE(lpClassName) &&
_wcsicmp(lpClassName, kTrayNotifyClass) == 0) {
// Subclass TrayNotifyWnd here and run SyncNotify once its children
// have been laid out.
}
return hWnd;
}Reference: 2. The taskbar lookup isn't limited to the current process (lines 247–251). HWND FindTrayNotify() {
HWND hTray = FindWindowW(kTrayWndClass, nullptr);
DWORD pid = 0;
if (!hTray || !GetWindowThreadProcessId(hTray, &pid) ||
pid != GetCurrentProcessId()) {
return nullptr;
}
return FindWindowExW(hTray, nullptr, kTrayNotifyClass, nullptr);
}(Or enumerate with a PID filter, like 3. The IME mode button is forced visible even when "Hide secondary IME mode glyph" is off. std::atomic<bool> g_imeModeHiddenByMod{false};
void EnforceImeModeHidden() {
HWND hImeMode = g_tray.hImeMode.load(std::memory_order_relaxed);
if (!hImeMode || !IsWindow(hImeMode)) {
return;
}
if (g_hideImeMode) {
if (IsWindowVisible(hImeMode)) {
g_imeModeHiddenByMod = true;
ShowWindow(hImeMode, SW_HIDE);
}
} else if (g_imeModeHiddenByMod.exchange(false)) {
ShowWindow(hImeMode, SW_SHOW);
}
}4. The 36 px single-glyph width is hard-coded and ignores display scaling (line 157). With "Hide secondary IME mode glyph" on and Optional improvements
Minor polish — none of this affects users, so it's your call.
Functionality notes
Non-critical observations and ideas about the feature behavior itself.
Code overview
For the maintainer: a map of the mod and what it touches outside its own process. Descriptive only — anything that needs a change is listed above. Line numbers refer to the mod source at commit Code regions
Side effects of interest
Next steps:
See the review process for details. Important: Each reply that was generated by AI must be disclosed by including the following text in the reply: "Generated by AI. Model: (ai-model-name)". |
|
/ai-review I updated the commit.
For other parts:
This is never an issue in reality tests. I asked the Agent to further prove it by reverse engineering, so it's decisive - zero width. regarding the "show only what you hide", I considered it at the very first stage and left it out:
So, adding and removing tray icons, and showing and hiding the chevron, all reach |
Submission reviewNote: This review was done by Claude. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Remember: The AI reviewer can be wrong - it may misread code, flag correct code as broken, or suggest changes that make things worse. Treat its findings as suggestions to verify, not instructions to follow blindly. You're responsible for the code you submit, so if a finding doesn't hold up, say so instead of changing working code to satisfy it. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. Thanks for the update. The process filter, the DPI handling and the atomics look good, and your reverse-engineering notes settle the IME mode button and the shift questions. One problem remains in the new startup path: The startup path runs
Enabling the mod mid-session isn't affected, because the tray is already laid out at that point. The problem only shows up after a sign-in or an Explorer restart. If you've confirmed that the children already exist and are positioned when LRESULT CALLBACK NotifyProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam,
DWORD_PTR /*dwRefData*/) {
LRESULT result = DefSubclassProc(hWnd, msg, wParam, lParam);
// Wire up once, after a layout pass has placed the children.
if (msg == WM_SIZE && !g_unloading.load(std::memory_order_relaxed) &&
!g_tray.hIndicator.load(std::memory_order_relaxed)) {
HWND hIndicator =
FindWindowExW(hWnd, nullptr, kIndicatorClass, nullptr);
RECT rc;
if (hIndicator && GetWindowRect(hIndicator, &rc) &&
rc.right > rc.left) {
HandleIdentifiedTrayNotify(hWnd);
}
}
return result;
}
// In HandleCreatedWindow, instead of calling HandleIdentifiedTrayNotify(hWnd):
g_tray.hNotify.store(hWnd, std::memory_order_relaxed);
WindhawkUtils::SetWindowSubclassFromAnyThread(hWnd, NotifyProc, 0);Also remove Optional improvements
Minor polish — none of this affects users, so it's your call.
Functionality notes
Non-critical observations and ideas about the feature behavior itself.
Code overview
For the maintainer: a map of the mod and what it touches outside its own process. Descriptive only — anything that needs a change is listed above. Line numbers refer to the mod source at commit Code regions
Side effects of interest
Next steps:
See the review process for details. Important: Each reply that was generated by AI must be disclosed by including the following text in the reply: "Generated by AI. Model: (ai-model-name)". |
… as virtual keyboard) creation. also revise condition guard checks and remove IsShellProcess() check.
|
/ai-review The startup path is actually fine. The indicator does exist when So the new design just register every child to the subclass, and decide if it requires moving afterwards, it's still cheap - no heavy runtime overhead. With this new design, the issue mentioned above is fixed, and your concern is gone as well. I also nuked
There is a sibling mod to handle win11. because the mechanism is totally different (win32 vs xaml), no common code is shared. The description mention both win10/win11 just to reflect the facts. Windows 10 taskbar on Windows11 might be an interest but not covered right now. hope it works (because the explorer.exe used to achieve this goal is a vanilla win10 one). |
Submission reviewNote: This review was done by Claude. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Remember: The AI reviewer can be wrong - it may misread code, flag correct code as broken, or suggest changes that make things worse. Treat its findings as suggestions to verify, not instructions to follow blindly. You're responsible for the code you submit, so if a finding doesn't hold up, say so instead of changing working code to satisfy it. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. Thanks for the details. Your reasoning about the indicator existing at The changes from your last comment aren't in the PR. The head is still
The new version should also cover these two cases:
// In CreateWindowExW_Hook, after the original call:
if (hWnd && parent &&
parent == g_tray.hNotify.load(std::memory_order_relaxed) &&
!g_unloading.load(std::memory_order_relaxed)) {
WindhawkUtils::SetWindowSubclassFromAnyThread(hWnd, ShiftRightProc, 0);
}
// In Wh_ModUninit, instead of walking g_tray.shift:
HWND hNotify = g_tray.hNotify.load(std::memory_order_relaxed);
if (IsOwnedByCurrentProcess(hNotify)) {
for (HWND child = GetWindow(hNotify, GW_CHILD); child;
child = GetWindow(child, GW_HWNDNEXT)) {
WindhawkUtils::RemoveWindowSubclassFromAnyThread(child, ShiftRightProc);
}
}On a mirrored (right-to-left) taskbar, the rect test picks the wrong side. Lines 384–394 compare Functionality notes
Non-critical observations and ideas about the feature behavior itself.
Code overview
For the maintainer: a map of the mod and what it touches outside its own process. Descriptive only — anything that needs a change is listed above. Line numbers refer to the mod source at commit Code regions
Side effects of interest
Next steps:
See the review process for details. Important: Each reply that was generated by AI must be disclosed by including the following text in the reply: "Generated by AI. Model: (ai-model-name)". |
|
/ai-review sorry for the commit gap. |
|
This pull request has already had 3 AI reviews in the last 24 hours, which is the limit, so no review was posted this time. Comment |
|
/ai-review
…On Sunday, November 15, 2026, windhawk-reviewer[bot] < ***@***.***> wrote:
*windhawk-reviewer[bot]* left a comment (ramensoftware/windhawk-mods#7447)
<#7447 (comment)>
This pull request has already had 3 AI reviews in the last 24 hours, which
is the limit, so no review was posted this time.
Comment /ai-review again after 2026-11-15 22:33 UTC (in 18 hours) to get
another one.
—
Reply to this email directly, view it on GitHub
<#7447?email_source=notifications&email_token=AANBFQUBXKTK3JEJIAHCFQ35ZEW6JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMOBYHEZDENBQGU4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6889224058>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANBFQXTW3WXNXZYELHEPUT5ZEW6JAVCNFSNUABFKJSXA33TNF2G64TZHM2DIOBSGYZTAMZYHNEXG43VMU5TMMZZGY3TSNBVHE22C5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AANBFQXOTEKF7UBXG3SVIVT5ZEW6JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMOBYHEZDENBQGU4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/AANBFQQ4FWBFVHHEBH2GXKD5ZEW6JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMOBYHEZDENBQGU4KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Submission reviewNote: This review was done by Claude. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Remember: The AI reviewer can be wrong - it may misread code, flag correct code as broken, or suggest changes that make things worse. Treat its findings as suggestions to verify, not instructions to follow blindly. You're responsible for the code you submit, so if a finding doesn't hold up, say so instead of changing working code to satisfy it. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. Both items from the last round are fixed. Bands created later get No blocking issues. Looks good to merge. Optional improvements
Minor polish — none of this affects users, so it's your call.
Functionality notes
Non-critical observations and ideas about the feature behavior itself.
Code overview
For the maintainer: a map of the mod and what it touches outside its own process. Descriptive only — anything that needs a change is listed above. Line numbers refer to the mod source at commit Code regions
Side effects of interest
Next steps:
See the review process for details. Important: Each reply that was generated by AI must be disclosed by including the following text in the reply: "Generated by AI. Model: (ai-model-name)". |
…tion/[un]init). Also fix potential race condition in uninit.
|
/ai-review just a cleanup round: I reordered the functions to make them logically grouped (settings/hook/injection/mod[un]init). The AI agent broke it badly. The comment is fixed. and the uninit race condition is fixed. The startup sequence is also proved by reverse engineering: IME icons are always created, just show/hide difference. |
Submission reviewNote: This review was done by Claude. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Remember: The AI reviewer can be wrong - it may misread code, flag correct code as broken, or suggest changes that make things worse. Treat its findings as suggestions to verify, not instructions to follow blindly. You're responsible for the code you submit, so if a finding doesn't hold up, say so instead of changing working code to satisfy it. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. This round fixes the two optional items from the last review:
You also confirmed that the indicator and its glyph windows always exist and are only shown or hidden. That settles the caching question from the functionality notes. The rest of the commit only moves functions around, and the logic is unchanged. No blocking issues. Looks good to merge. Optional improvements
Minor polish — none of this affects users, so it's your call.
Functionality notes
Non-critical observations and ideas about the feature behavior itself.
Code overview
For the maintainer: a map of the mod and what it touches outside its own process. Descriptive only — anything that needs a change is listed above. Line numbers refer to the mod source at commit Code regions
Side effects of interest
Next steps:
See the review process for details. Important: Each reply that was generated by AI must be disclosed by including the following text in the reply: "Generated by AI. Model: (ai-model-name)". |
|
/ready-for-reviewer |
This fixes the "misclick" issue caused by IME tray icon width bouncing.
In a multilingual input environment on Windows 10 / 11, the Input Indicator in the system tray toggles its width between "1 glyph" and "2 glyphs". Because the notification area is anchored to the right edge, this width change shifts the tray icons that sit to the left of the indicator. When "Let me set a different input method for each app window" is enabled, clicking a tray icon can end up hitting a neighboring icon instead (a misclick).
After the Fix - moving the IME tray icons to the leftmost:
Mimicking Docked Language Bar?
Yes. But the docked language bar is broken in win10 (unstable, and won't work in remote desktop - even if you enable this option in both sides, and the latest MSPY doesn't support it unless you turn on "Use the old version of MSPY") and is completely removed in win11.
AI Contribution Statement
The reverse engineering and the source code were completed by an AI agent (deepseek v4.1 flash). The final mod products, however, were guided and audited by the author to make sure no unnecessary extra performance overhead was introduced (the AI had previously introduced a repeating timer or an extra thread). The author verified and confirmed both the tech stack and the concrete implementation.
Changelog
If this pull request updates an existing mod, describe the changes inside the changelog markers:
Mod authorship
If this pull request introduces a new mod, please complete the section below.
This mod was created by: