summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-01 16:02:26 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-01 16:02:26 +0000
commitf01af9c4e6f1438cd1112cfff42f3837028c7846 (patch)
tree781cacd6a6e21dd4c8c2c8b4377a69126f4cfb24 /src
parent3e7637bd266da43c9158f0e1cfe3f7f7843d7147 (diff)
downloadvim-git-f01af9c4e6f1438cd1112cfff42f3837028c7846.tar.gz
patch 8.2.4486: MS-Windows GUI: slow scrolling with maximized windowv8.2.4486
Problem: MS-Windows GUI: slow scrolling with maximized window. Solution: Use a better way to check the window is on screen. (Ken Takata, closes #9865)
Diffstat (limited to 'src')
-rw-r--r--src/gui_w32.c19
-rw-r--r--src/version.c2
2 files changed, 15 insertions, 6 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c
index ec6267178..584e4ef3e 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -3016,7 +3016,7 @@ is_point_onscreen(int x, int y)
}
/*
- * Check if the whole area of the specified window is on-screen.
+ * Check if the whole client area of the specified window is on-screen.
*
* Note about DirectX: Windows 10 1809 or above no longer maintains image of
* the window portion that is off-screen. Scrolling by DWriteContext_Scroll()
@@ -3026,16 +3026,23 @@ is_point_onscreen(int x, int y)
is_window_onscreen(HWND hwnd)
{
RECT rc;
+ POINT p1, p2;
- GetWindowRect(hwnd, &rc);
+ GetClientRect(hwnd, &rc);
+ p1.x = rc.left;
+ p1.y = rc.top;
+ p2.x = rc.right - 1;
+ p2.y = rc.bottom - 1;
+ ClientToScreen(hwnd, &p1);
+ ClientToScreen(hwnd, &p2);
- if (!is_point_onscreen(rc.left, rc.top))
+ if (!is_point_onscreen(p1.x, p1.y))
return FALSE;
- if (!is_point_onscreen(rc.left, rc.bottom))
+ if (!is_point_onscreen(p1.x, p2.y))
return FALSE;
- if (!is_point_onscreen(rc.right, rc.top))
+ if (!is_point_onscreen(p2.x, p1.y))
return FALSE;
- if (!is_point_onscreen(rc.right, rc.bottom))
+ if (!is_point_onscreen(p2.x, p2.y))
return FALSE;
return TRUE;
}
diff --git a/src/version.c b/src/version.c
index a574acb3a..e563142a1 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 */
/**/
+ 4486,
+/**/
4485,
/**/
4484,