Repository navigation
Fix working area changed on windows platform won't update screen - #21707
Conversation
|
You can test this PR using the following package version. |
|
You can test this PR using the following package version. |
| // SPI_SETWORKAREA | ||
| if (wParam == 0x002F) | ||
| { | ||
| Screen?.OnChanged(); |
There was a problem hiding this comment.
Don't do this in the window-specific wndproc. Use Win32Platform.WndProc instead, which is meant for "global" messages.
There was a problem hiding this comment.
Logic move to existing WindowsMessage.WM_SETTINGCHANGE if statement in Win32Platform.WndProc.
Avalonia/src/Windows/Avalonia.Win32/Win32Platform.cs
Lines 178 to 195 in 8193052
There was a problem hiding this comment.
I just notice that this statement will only run if PlatformSettings is Win32PlatformSettings win32PlatformSettings...
Should I make a new if statement for this patch?
There was a problem hiding this comment.
Keep a single if (msg == (uint)WindowsMessage.WM_SETTINGCHANGE) for both but wrap the existing color change with an inner if (PlatformSettings is Win32PlatformSettings win32PlatformSettings)
…ead of WindowImpl.AppWndProc
… is Win32PlatformSettings
|
You can test this PR using the following package version. |
What does the pull request do?
This pull request will call
Screen?.OnChanged()when received window messageWM_SETTINGCHANGEwithwParamSPI_SETWORKAREA.What is the current behavior?
Screens.Changedwon't trigger and screenWorkingAreaproperty won't updated if only working area changed.(Change taskbar position or size will change the working area)
What is the updated/expected behavior with this PR?
Screens.Changedwill trigger and screenWorkingAreaproperty will also update if working area changed.How was the solution implemented (if it's not obvious)?
This pull request add a
caseforWM_SETTINGCHANGEinAppWndProc, which will callScreen?.OnChanged(), update the screen working area property and triggerScreens.Changed.Test Video
See
WorkingAreaandScreens.Changed Trigger Counter2026-07-05.23-31-44.mp4
Checklist
Fixed issues
Fixes #19006