You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there is a bug related to Maximize/Minimize state.
In this case window will cover full screen (even when FullScreen option is disabled).
Steps to replicate:
Open (any) application and set to Maximized state
Press Minimize
Click on taskbar to restore -> bug occurs which will set application to Full Screen instead of restoring it to previous Maximize state.
As a quick fix I did simple bypass in 2 classes :
WinProc:
switch statement WindowsMessage.WM_SIZE:
`
var size = (SizeCommand)wParam;
if (_lastWindowState == WindowState.Minimized && (size == SizeCommand.Maximized))
{
var clientSize = new Size(ToInt32(lParam) & 0xffff, (ToInt32(lParam) >> 16));
Resize(clientSize, _resizeReason);
Resized(clientSize / RenderScaling, _resizeReason);
}
else if (Resized != null &&
(size == SizeCommand.Restored ||
size == SizeCommand.Maximized))
{
var clientSize = new Size(ToInt32(lParam) & 0xffff, ToInt32(lParam) >> 16);
Resized(clientSize / RenderScaling, _resizeReason);
}
var windowState = size switch
{
SizeCommand.Maximized => WindowState.Maximized,
SizeCommand.Minimized => WindowState.Minimized,
_ when _isFullScreenActive => WindowState.FullScreen,
_ => WindowState.Normal,
};
if (windowState != _lastWindowState)
{
_lastWindowState = windowState;
WindowStateChanged?.Invoke(windowState);
if (_isClientAreaExtended)
{
UpdateExtendMargins();
ExtendClientAreaToDecorationsChanged?.Invoke(true);
}
}
return IntPtr.Zero;`
WindowImpl (need to verify for Linux):
change Resize call by adding the following line of code at the top of the Resize method call: if(WindowState == WindowState.Maximized) { MaximizeWithoutCoveringTaskbar(); }
Hopefully this will help someone who experienced similar issue.
Please note this is still not a final solution. There is another bug? related to regular maximize state. Application surface is maximized, but it's still not proper Maximized state (you can confirm that by bringing cursor close to the border, you will notice it can resize the surface).
The text was updated successfully, but these errors were encountered:
dax-leo
changed the title
Restore minimized form when previous state is Maximized
Bug: Restore "minimized form" when previous state is "Maximized" fills the screen.
May 19, 2023
Hi,
there is a bug related to Maximize/Minimize state.
In this case window will cover full screen (even when FullScreen option is disabled).
Steps to replicate:
As a quick fix I did simple bypass in 2 classes :
WinProc:
switch statement WindowsMessage.WM_SIZE:
`
WindowImpl (need to verify for Linux):
change Resize call by adding the following line of code at the top of the Resize method call:
if(WindowState == WindowState.Maximized) { MaximizeWithoutCoveringTaskbar(); }
Hopefully this will help someone who experienced similar issue.
Please note this is still not a final solution. There is another bug? related to regular maximize state. Application surface is maximized, but it's still not proper Maximized state (you can confirm that by bringing cursor close to the border, you will notice it can resize the surface).
The text was updated successfully, but these errors were encountered: