Repository navigation
Conversation
…ar gets no button ITaskbarList::HrInit finds the task band through the TaskbandHWND property of the first Shell_TrayWnd. That is the bar's own (hidden, topmost) tray host, which had no such property, so HrInit failed with E_NOTIMPL for every app while the bar ran. DeleteTab, AddTab and the rest then did nothing, and a window an app hid from the taskbar (Tauri's skipTaskbar, for example) still got a button on the bar. The tray host now names itself as the task band. DeleteTab and AddTab arrive there as SHELLHOOK messages (HSHELL_WINDOWDESTROYED / HSHELL_WINDOWCREATED for a window that lives on), and collect() leaves those windows out.
Owner
Lemxy
added a commit
that referenced
this pull request
Nov 26, 2026
RexxColder
pushed a commit
to RexxColder/WinRust
that referenced
this pull request
Nov 26, 2026
…gets no button (upstream Lemxy#163) Ported from upstream 09ef3d0 (Lemxy#163 by @Tkyoxx): ITaskbarList::HrInit reads the task band from a "TaskbandHWND" property of the first Shell_TrayWnd, which is ours, so HrInit failed (E_NOTIMPL) for every app while the bar ran. The host window now carries that property, and DeleteTab / AddTab (HSHELL_WINDOWDESTROYED / CREATED) add the window to a skip list the button collector honours: an app that hides its own taskbar button (Tauri, some launchers) now really loses it, and AddTab gives it back. Closed windows are forgotten.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
While topbar runs,
ITaskbarList::HrInitfails withE_NOTIMPL(0x80004001) for every app on the PC.HrInit reads the task band from the
TaskbandHWNDproperty of the firstShell_TrayWndit finds. That window is topbar's tray host, which is topmost so thatShell_NotifyIconfinds it first, and it had no such property. As a resultDeleteTab,AddTaband the rest did nothing.So a window that its app took off the taskbar still got a button on the bar. I saw it with a Tauri app whose full-screen overlay window has
skipTaskbar: trueand the stylesWS_EX_TOOLWINDOW | WS_EX_APPWINDOW: it showed up as a button.How ITaskbarList reaches the taskbar
I checked this with a probe: a fake
Shell_TrayWnd, thenHrInit,DeleteTabandAddTabon a test window.TaskbandHWNDset, HrInit succeeds.DeleteTabsends the registeredSHELLHOOKmessage to that window, with wParam 2 (HSHELL_WINDOWDESTROYED) and the window in lParam.AddTabsends the same message with wParam 1.Fix
TaskbandHWNDto itself and letsSHELLHOOKthrough UIPI, since the bar may run elevated.tray_prockeeps the windows that were taken off inSKIP.AddTabgives a window its button back, and closed windows are forgotten.collect()leaves the windows inSKIPout.TaskbarCreatedwhen it starts, and Tauri (tao) callsDeleteTabagain when it gets that message.Test
cargo test -p topbarpasses, including the newdelete_tab_hides_and_add_tab_brings_back.