changeset 7125:52a7ba315f03 v7.4.874

commit https://github.com/vim/vim/commit/8919554fe17255cddbbce6b833fab9aba19c8b88 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Sep 25 15:00:31 2015 +0200 patch 7.4.874 Problem: MS-Windows: When Vim runs inside another application, the size isn't right. Solution: When in child mode compute the size differently. (Agorgianitis Loukas)
author Christian Brabandt <cb@256bit.org>
date Fri, 25 Sep 2015 15:15:04 +0200
parents 4e071674d8dc
children 2477c368e181
files src/gui_w48.c src/version.c
diffstat 2 files changed, 23 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -3335,17 +3335,30 @@ gui_mch_newfont()
     RECT	rect;
 
     GetWindowRect(s_hwnd, &rect);
-    gui_resize_shell(rect.right - rect.left
-			- (GetSystemMetrics(SM_CXFRAME) +
-			   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
-		     rect.bottom - rect.top
-			- (GetSystemMetrics(SM_CYFRAME) +
-			   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
-			- GetSystemMetrics(SM_CYCAPTION)
+    if (win_socket_id == 0)
+    {
+	gui_resize_shell(rect.right - rect.left
+	    - (GetSystemMetrics(SM_CXFRAME) +
+	       GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
+	    rect.bottom - rect.top
+	    - (GetSystemMetrics(SM_CYFRAME) +
+	       GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+	    - GetSystemMetrics(SM_CYCAPTION)
+#ifdef FEAT_MENU
+	    - gui_mswin_get_menu_height(FALSE)
+#endif
+	);
+    }
+    else
+    {
+	/* Inside another window, don't use the frame and border. */
+	gui_resize_shell(rect.right - rect.left,
+	    rect.bottom - rect.top
 #ifdef FEAT_MENU
 			- gui_mswin_get_menu_height(FALSE)
 #endif
-	    );
+	);
+    }
 }
 
 /*
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    874,
+/**/
     873,
 /**/
     872,