summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-17 22:26:53 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-17 22:26:53 +0200
commitb68ced5f07a3cd6c01cf8fa2156f2e2949d2d4f1 (patch)
tree684d3db041a295b480beadd841db0baba05e9e7c
parent945c857844b74866f90be20714aefc3149d2a991 (diff)
patch 8.2.1232: MS-Windows GUI: Snap cancelled by split commandv8.2.1232
Problem: MS-Windows GUI: Snap cancelled by split command. Solution: Do not cancel Snap when splitting a window. (Ken Takata, closes #6467)
-rw-r--r--src/gui_w32.c22
-rw-r--r--src/version.c2
2 files changed, 20 insertions, 4 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 46358dc131..19db1a33ad 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -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);
-
- 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;
}
/*
diff --git a/src/version.c b/src/version.c
index 68c1e820c4..659b6932b9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1232,
+/**/
1231,
/**/
1230,