From 8fa1d8a955ea8a558c80f4da797c401649c93592 Mon Sep 17 00:00:00 2001 From: Rainer Kottenhoff Date: Mon, 3 Sep 2018 11:15:01 +0200 Subject: [PATCH] + fix: monitor selection bug for new F11/Ctrl+F11 toggle --- src/Notepad3.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index d13c6276e..f19332780 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -992,12 +992,8 @@ void EndWaitCursor() static void __fastcall _InitDefaultWndPos(WININFO* pWinInfo) { - RECT rcMon = RectFromWinInfo(pWinInfo); - GetMonitorWorkArea(&rcMon); - - WININFO wiWorkArea = INIT_WININFO; - FitIntoMonitorWorkArea(&rcMon, &wiWorkArea, true); // get Monitor and Work Area - RECT const rc = RectFromWinInfo(&wiWorkArea); // use Work Area as RECT + RECT rc = RectFromWinInfo(pWinInfo); + GetMonitorWorkArea(&rc); pWinInfo->y = rc.top + _BORDEROFFSET; pWinInfo->cy = rc.bottom - rc.top - (_BORDEROFFSET * 2); @@ -5599,12 +5595,15 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) break; case CMD_FULLSCRWINPOS: - SnapToWinInfoPos(hwnd, &g_WinInfo, true); + { + WININFO winfo = GetMyWindowPlacement(g_hwndMain, NULL); + SnapToWinInfoPos(hwnd, &winfo, true); + } break; case CMD_DEFAULTWINPOS: { - WININFO winfo = g_WinInfo; + WININFO winfo = GetMyWindowPlacement(g_hwndMain, NULL); _InitDefaultWndPos(&winfo); SnapToWinInfoPos(hwnd, &winfo, false); }