fix: add check in IsMaximized for non-WS_THICKFRAME windows (#26586)
* fix: add check in IsMaximized for non-WS_THICKFRAME windows * remove logs * change GetPosition for GetNativeWindow * change GetPosition for GetNativeWindow in IsMaximize * add top left corner check * add transparent maximization test * replace window and display comparison * rebase off master
This commit is contained in:
parent
acfbbe9869
commit
32d4c9ad85
3 changed files with 36 additions and 5 deletions
|
@ -530,6 +530,20 @@ void NativeWindowViews::Unmaximize() {
|
|||
}
|
||||
|
||||
bool NativeWindowViews::IsMaximized() {
|
||||
// For window without WS_THICKFRAME style, we can not call IsMaximized().
|
||||
// This path will be used for transparent windows as well.
|
||||
|
||||
#if defined(OS_WIN)
|
||||
if (!(::GetWindowLong(GetAcceleratedWidget(), GWL_STYLE) & WS_THICKFRAME)) {
|
||||
// Compare the size of the window with the size of the display
|
||||
auto display = display::Screen::GetScreen()->GetDisplayNearestWindow(
|
||||
GetNativeWindow());
|
||||
// Maximized if the window is the same dimensions and placement as the
|
||||
// display
|
||||
return GetBounds() == display.work_area();
|
||||
}
|
||||
#endif
|
||||
|
||||
return widget()->IsMaximized();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue