summaryrefslogtreecommitdiffstats
path: root/src/gui_w32.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-07-21 17:53:58 +0200
committerBram Moolenaar <Bram@vim.org>2013-07-21 17:53:58 +0200
commit9d48895e4c65e54d0436b76e48336e3c2ace0bf6 (patch)
tree2912fd39f5a25f7c5fd013e8570b0fb05cb60c91 /src/gui_w32.c
parent5f919ee8ebe15906bf865e772d5b922438e95ec0 (diff)
updated for version 7.4a.038v7.4a.038
Problem: When using MSVC 2012 there are various issues, including GUI size computations. Solution: Use SM_CXPADDEDBORDER. (Mike Williams)
Diffstat (limited to 'src/gui_w32.c')
-rw-r--r--src/gui_w32.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 5ec14983ec..c59308324a 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -1694,8 +1694,10 @@ gui_mch_set_shellsize(int width, int height,
}
/* compute the size of the outside of the window */
- win_width = width + GetSystemMetrics(SM_CXFRAME) * 2;
- win_height = height + GetSystemMetrics(SM_CYFRAME) * 2
+ win_width = width + (GetSystemMetrics(SM_CXFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+ win_height = height + (GetSystemMetrics(SM_CYFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+ GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
+ gui_mswin_get_menu_height(FALSE)
@@ -2546,13 +2548,15 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
get_work_area(&workarea_rect);
*screen_w = workarea_rect.right - workarea_rect.left
- - GetSystemMetrics(SM_CXFRAME) * 2;
+ - (GetSystemMetrics(SM_CXFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
/* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
* the menubar for MSwin, we subtract it from the screen height, so that
* the window size can be made to fit on the screen. */
*screen_h = workarea_rect.bottom - workarea_rect.top
- - GetSystemMetrics(SM_CYFRAME) * 2
+ - (GetSystemMetrics(SM_CYFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
- GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU
- gui_mswin_get_menu_height(FALSE)
@@ -3182,12 +3186,14 @@ gui_mch_dialog(
/* Use our own window for the size, unless it's very small. */
GetWindowRect(s_hwnd, &rect);
maxDialogWidth = rect.right - rect.left
- - GetSystemMetrics(SM_CXFRAME) * 2;
+ - (GetSystemMetrics(SM_CXFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
if (maxDialogWidth < DLG_MIN_MAX_WIDTH)
maxDialogWidth = DLG_MIN_MAX_WIDTH;
maxDialogHeight = rect.bottom - rect.top
- - GetSystemMetrics(SM_CXFRAME) * 2;
+ - (GetSystemMetrics(SM_CXFRAME) +
+ GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
if (maxDialogHeight < DLG_MIN_MAX_HEIGHT)
maxDialogHeight = DLG_MIN_MAX_HEIGHT;
}