Repository navigation
fix(Taskbar10): type in the Windows 10 taskbar search box on Windows 11 (#4672) - #5219
Open
noel-digital-fan wants to merge 3 commits into
Open
noel-digital-fan wants to merge 3 commits into
noel-digital-fan wants to merge 3 commits into
Conversation
…11 (valinet#4672) With the Windows 10 (ExplorerPatcher) taskbar, clicking the search box made it disappear, and the Windows 11 search app showed its own search box at the top of its window instead. * Keep the search box visible while Search is open. ep_taskbar hid it 900 ms after the search app showed, expecting the Windows 10 search app to draw its own search box over it. * Report TaskbarSearchMode::SearchBox instead of SearchIcon along with the Start menu positioning while the search box is shown on a bottom taskbar, so that the search app (SearchHost.exe) uses its layout for a search box on the taskbar instead of the one with a search box at the top. Report again when the search box or small icons setting changes. * Load into the UI thread of the search app when it comes to the foreground, make its text box invisible (it keeps the focus), and draw its text, selection and a caret in the Windows 10 search box instead of the placeholder text. When the search app comes up with Start, collapse its search box, so that Start has none, like on Windows 10, and what is typed shows up in the search box on the taskbar.
Author
|
Closing for now while I rework a few things (panel attachment to the taskbar, scoping, readability). I'll open a new one when it's ready. |
…changes to the Windows 10 taskbar - Attach the search panel right on top of the taskbar at the left edge of the screen, with square corners and no shadow, like on Windows 10, however search is opened (search box, Start button or Windows key) - Only change the search app and the search mode reported to it when the Windows 10 (ExplorerPatcher) taskbar is used on Windows 11; the Windows 11 taskbar is left alone - Apply the changes again when the search app is activated, resized or typed in, in case it shows up again without raising VisibilityChanged - Refresh the Start menu position when the taskbar search box setting or the taskbar icon size changes - Rename things and add comments to make the code easier to follow
|
are you using ai for this? |
…ed up with its search box - Line the panel up with the left edge of the search box on the taskbar, right after the Start button, however search is opened; the search app's window is moved there once it is in the foreground, whenever the search app moves it - Attach the panel after resizing the hidden search box, which changes the height of the panel - Check where the panel is after every layout pass, and before every frame for a moment after search shows up, as the search app moves the panel without resizing it, sometimes without even laying it out again
Author
|
Yes, It was made with Claude Opus 5.5. Please consider reviewing the code, even if you don't intend to merge it because of AI. It might prove some useful ideas or implementations that you could replicate in your own code. Thanks for the consideradion |
|
You need to understand the code you're submitting. |
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.
Fixes #4672
Fixes #3107
With the Windows 10 (ExplorerPatcher) taskbar on Windows 11 and Search set to "Search box", clicking the search box made it disappear. The Windows 11 search app (SearchHost.exe) then opened as a floating window with its own search box at the top. With this change, search works like on Windows 10: you type in the "Type here to search" box on the taskbar, and the results show up in a panel attached to the taskbar, right above the search box.
I know both issues were closed as "Won't Fix", so please consider reviewing this as a reference for a future update. This was made with the help of Claude Opus 5.5. Thanks for ExplorerPatcher!
Cause
WindowsUdk.UI.Shell.TaskbarLayoutreportsTaskbarSearchMode::SearchBoxand Search button bounds of at least 200×32. ep_taskbar already reports the bounds, but theITaskbarSettingsthatStartMenu.creports for the Start menu positioning always returnedSearchIconforSearchModeandEffectiveSearchMode.TrayDummySearchControlarms a 900 ms timer when the search app is shown and then hides itself. It expects the Windows 10 search app to draw its own search box over it, which SearchHost doesn't do.Changes
StartMenu.c: reportSearchBoxwhile ep_taskbar shows the search box (search box mode, no small icons, bottom taskbar).dllmain.creports again whenSearchboxTaskbarModeorTaskbarSmallIconschanges, through the primary taskbar, as for display changes.dllmain.c: don't arm that 900 ms timer (SetTimerhooked in ep_taskbar's IAT), so the search box stays on the taskbar.Taskbar10SearchBox.cpp: when SearchHost comes to the foreground, EP is loaded into its UI thread with aWH_GETMESSAGEhook.WM_COPYDATA, and the placeholder control of the Windows 10 search box is subclassed to draw them with a caret instead of the placeholder text.SWP_NOSENDCHANGING, so window moves are handled inWM_WINDOWPOSCHANGED. Right after it shows up, SearchHost also moves the panel without a layout pass. So for one second after showing up, the panel position is also checked before every frame (CompositionTarget::Rendering).All of this is only active with the Windows 10 (ExplorerPatcher) taskbar on Windows 11. The Windows 11 taskbar is not affected.
Screenshots
Testing
Tested on Windows 11 26300.9711 x64 with
ep_taskbar.ge.dll, the Windows 10 Start menu, one monitor at 125%, and the dark theme:Not tested: the light theme, multiple monitors, ARM64, and other ep_taskbar builds. Top and side taskbars keep the previous behavior, since
SearchBoxis only reported for bottom taskbars.Notes
TaskbarSearchPageby name (SearchBoxControl,TaskbarSearchBackground,SearchTextBox,AppBorder,OuterBorderGrid,QueryFormulationRoot,HCOuterBorderGrid, and theSearchBoxLocationStatesvisual state group ofRootGrid). If a SearchHost update renames them, the changes that depend on them are skipped.