flatlaf-natives-windows: fixed invocation of GetMonitorInfo() (issue #798)

also removed unnecessary setting `mii.fType`
This commit is contained in:
Karl Tauber
2024-01-23 15:40:10 +01:00
parent 96b7770ab2
commit c85baf4dc6
4 changed files with 1 additions and 1 deletions

View File

@@ -377,6 +377,7 @@ LRESULT FlatWndProc::WmNcCalcSize( HWND hwnd, int uMsg, WPARAM wParam, LPARAM lP
// (using MONITOR_DEFAULTTONEAREST finds right monitor when restoring from minimized) // (using MONITOR_DEFAULTTONEAREST finds right monitor when restoring from minimized)
HMONITOR hMonitor = ::MonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST ); HMONITOR hMonitor = ::MonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST );
MONITORINFO monitorInfo{ 0 }; MONITORINFO monitorInfo{ 0 };
monitorInfo.cbSize = sizeof( monitorInfo );
::GetMonitorInfo( hMonitor, &monitorInfo ); ::GetMonitorInfo( hMonitor, &monitorInfo );
// If there's a taskbar on any side of the monitor, reduce our size // If there's a taskbar on any side of the monitor, reduce our size
@@ -537,7 +538,6 @@ void FlatWndProc::setMenuItemState( HMENU systemMenu, int item, bool enabled ) {
MENUITEMINFO mii{ 0 }; MENUITEMINFO mii{ 0 };
mii.cbSize = sizeof( mii ); mii.cbSize = sizeof( mii );
mii.fMask = MIIM_STATE; mii.fMask = MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = enabled ? MF_ENABLED : MF_DISABLED; mii.fState = enabled ? MF_ENABLED : MF_DISABLED;
::SetMenuItemInfo( systemMenu, item, FALSE, &mii ); ::SetMenuItemInfo( systemMenu, item, FALSE, &mii );
} }