Repository navigation
fix: display changes leave "ghost" taskbar area on main monitor - #5225
Open
bogenpirat wants to merge 1 commit into
Open
bogenpirat wants to merge 1 commit into
bogenpirat wants to merge 1 commit into
Conversation
|
was this done using ai? |
Author
|
yes, it was |
|
you must understand the code you are submitting before submitting it. |
Author
|
is this general educational advice, or does the code have room for improvement in any specific places? i'm an SWE by trade, but haven't worked much on windows internals as this project surely warrants. there's a fair chance that despite thinking i've got a reasonable grasp of what the fix does, i've missed something in the bigger picture. |
|
we don't accept code that is generated by ai. |
Author
|
shame, but i understand. feel free to close this, then. |
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.
setup
reproduce
the display configuration is changed, e.g. by turning HDR off/on on one of the screens, or changing the refresh rate(s)
symptoms
underlying issue, summarized by opus
Before applying a display change, the system sends message 0x344 to the taskman window (MSTaskSwWClass) to get predicted work areas for each monitor, then applies them with the change. No hidden window is involved; only the work areas are wrong. CTray::GuessStuckRectPlaceAndSizeAfterRecalc assumes the taskbar is on the primary monitor unless it's shown on all displays. That holds for the Windows 11 taskbar, but the Windows 10 taskbar can be moved, so the taskbar's space gets reserved on the wrong monitor. Nothing corrects it afterwards because the taskbar itself didn't change, so Explorer doesn't recompute the work areas.
description of the fix, work done by opus as well
Subclass MSTaskSwWClass and return 0 from 0x344 when the taskbar is on a non-primary monitor and no secondary taskbars exist. This is the same "no prediction" result CTray::FillInDisplayChangeData returns when an appbar occupies screen space. Other configurations keep the existing behavior.