Mercurial > vim
changeset 21363:ef2290a53dd0 v8.2.1232
patch 8.2.1232: MS-Windows GUI: Snap cancelled by split command
Commit: https://github.com/vim/vim/commit/b68ced5f07a3cd6c01cf8fa2156f2e2949d2d4f1
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 17 22:26:53 2020 +0200
patch 8.2.1232: MS-Windows GUI: Snap cancelled by split command
Problem: MS-Windows GUI: Snap cancelled by split command.
Solution: Do not cancel Snap when splitting a window. (Ken Takata,
closes #6467)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 17 Jul 2020 22:30:05 +0200 |
parents | 7a2626ac7097 |
children | 7a3653107fc5 |
files | src/gui_w32.c src/version.c |
diffstat | 2 files changed, 20 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -3342,19 +3342,33 @@ gui_mch_init_font(char_u *font_name, int /* * Return TRUE if the GUI window is maximized, filling the whole screen. + * Also return TRUE if the window is snapped. */ int gui_mch_maximized(void) { WINDOWPLACEMENT wp; + RECT rc; wp.length = sizeof(WINDOWPLACEMENT); if (GetWindowPlacement(s_hwnd, &wp)) - return wp.showCmd == SW_SHOWMAXIMIZED + { + if (wp.showCmd == SW_SHOWMAXIMIZED || (wp.showCmd == SW_SHOWMINIMIZED - && wp.flags == WPF_RESTORETOMAXIMIZED); - - return 0; + && wp.flags == WPF_RESTORETOMAXIMIZED)) + return TRUE; + if (wp.showCmd == SW_SHOWMINIMIZED) + return FALSE; + + // Assume the window is snapped when the sizes from two APIs differ. + GetWindowRect(s_hwnd, &rc); + if ((rc.right - rc.left != + wp.rcNormalPosition.right - wp.rcNormalPosition.left) + || (rc.bottom - rc.top != + wp.rcNormalPosition.bottom - wp.rcNormalPosition.top)) + return TRUE; + } + return FALSE; } /*