0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

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)
This commit is contained in:
Bram Moolenaar 2020-07-17 22:26:53 +02:00
parent 945c857844
commit b68ced5f07
2 changed files with 19 additions and 3 deletions

View File

@ -3342,19 +3342,33 @@ gui_mch_init_font(char_u *font_name, int fontset UNUSED)
/*
* 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);
&& wp.flags == WPF_RESTORETOMAXIMIZED))
return TRUE;
if (wp.showCmd == SW_SHOWMINIMIZED)
return FALSE;
return 0;
// 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;
}
/*

View File

@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1232,
/**/
1231,
/**/