comparison src/gui_w32.c @ 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 75514c95b948
children c19acd92ee83
comparison
equal deleted inserted replaced
21362:7a2626ac7097 21363:ef2290a53dd0
3340 # define WPF_RESTORETOMAXIMIZED 2 // just in case someone doesn't have it 3340 # define WPF_RESTORETOMAXIMIZED 2 // just in case someone doesn't have it
3341 #endif 3341 #endif
3342 3342
3343 /* 3343 /*
3344 * Return TRUE if the GUI window is maximized, filling the whole screen. 3344 * Return TRUE if the GUI window is maximized, filling the whole screen.
3345 * Also return TRUE if the window is snapped.
3345 */ 3346 */
3346 int 3347 int
3347 gui_mch_maximized(void) 3348 gui_mch_maximized(void)
3348 { 3349 {
3349 WINDOWPLACEMENT wp; 3350 WINDOWPLACEMENT wp;
3351 RECT rc;
3350 3352
3351 wp.length = sizeof(WINDOWPLACEMENT); 3353 wp.length = sizeof(WINDOWPLACEMENT);
3352 if (GetWindowPlacement(s_hwnd, &wp)) 3354 if (GetWindowPlacement(s_hwnd, &wp))
3353 return wp.showCmd == SW_SHOWMAXIMIZED 3355 {
3356 if (wp.showCmd == SW_SHOWMAXIMIZED
3354 || (wp.showCmd == SW_SHOWMINIMIZED 3357 || (wp.showCmd == SW_SHOWMINIMIZED
3355 && wp.flags == WPF_RESTORETOMAXIMIZED); 3358 && wp.flags == WPF_RESTORETOMAXIMIZED))
3356 3359 return TRUE;
3357 return 0; 3360 if (wp.showCmd == SW_SHOWMINIMIZED)
3361 return FALSE;
3362
3363 // Assume the window is snapped when the sizes from two APIs differ.
3364 GetWindowRect(s_hwnd, &rc);
3365 if ((rc.right - rc.left !=
3366 wp.rcNormalPosition.right - wp.rcNormalPosition.left)
3367 || (rc.bottom - rc.top !=
3368 wp.rcNormalPosition.bottom - wp.rcNormalPosition.top))
3369 return TRUE;
3370 }
3371 return FALSE;
3358 } 3372 }
3359 3373
3360 /* 3374 /*
3361 * Called when the font changed while the window is maximized or GO_KEEPWINSIZE 3375 * Called when the font changed while the window is maximized or GO_KEEPWINSIZE
3362 * is set. Compute the new Rows and Columns. This is like resizing the 3376 * is set. Compute the new Rows and Columns. This is like resizing the