patch 7.4.869 v7.4.869
authorBram Moolenaar <Bram@vim.org>
Tue, 15 Sep 2015 15:58:29 +0000 (17:58 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 15 Sep 2015 15:58:29 +0000 (17:58 +0200)
Problem:    MS-Windows: scrolling may cause text to disappear when using an
            Intel GPU.
Solution:   Call GetPixel(). (Yohei Endo)

src/gui_w48.c
src/version.c

index b40a6b9e00b1666f0d12a45ce52262c7630ef734..bff67a813103d041e0eeaee08626d1e2856cb19a 100644 (file)
@@ -2389,7 +2389,7 @@ show_tabline_popup_menu(void)
        return;
 
     if (first_tabpage->tp_next != NULL)
-        add_tabline_popup_menu_entry(tab_pmenu,
+       add_tabline_popup_menu_entry(tab_pmenu,
                                          TABLINE_MENU_CLOSE, _("Close tab"));
     add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
     add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
@@ -2931,10 +2931,10 @@ gui_mswin_get_valid_dimensions(
 
     base_width = gui_get_base_width()
        + (GetSystemMetrics(SM_CXFRAME) +
-           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
+          GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
     base_height = gui_get_base_height()
        + (GetSystemMetrics(SM_CYFRAME) +
-           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+          GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
        + GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
        + gui_mswin_get_menu_height(FALSE)
@@ -2996,6 +2996,20 @@ get_scroll_flags(void)
     return 0;
 }
 
+/*
+ * On some Intel GPUs, the regions drawn just prior to ScrollWindowEx()
+ * may not be scrolled out properly.
+ * For gVim, when _OnScroll() is repeated, the character at the
+ * previous cursor position may be left drawn after scroll.
+ * The problem can be avoided by calling GetPixel() to get a pixel in
+ * the region before ScrollWindowEx().
+ */
+    static void
+intel_gpu_workaround(void)
+{
+    GetPixel(s_hdc, FILL_X(gui.col), FILL_Y(gui.row));
+}
+
 /*
  * Delete the given number of lines from the given row, scrolling up any
  * text further down within the scroll region.
@@ -3007,6 +3021,8 @@ gui_mch_delete_lines(
 {
     RECT       rc;
 
+    intel_gpu_workaround();
+
     rc.left = FILL_X(gui.scroll_region_left);
     rc.right = FILL_X(gui.scroll_region_right + 1);
     rc.top = FILL_Y(row);
@@ -3038,6 +3054,8 @@ gui_mch_insert_lines(
 {
     RECT       rc;
 
+    intel_gpu_workaround();
+
     rc.left = FILL_X(gui.scroll_region_left);
     rc.right = FILL_X(gui.scroll_region_right + 1);
     rc.top = FILL_Y(row);
@@ -3319,10 +3337,10 @@ gui_mch_newfont()
     GetWindowRect(s_hwnd, &rect);
     gui_resize_shell(rect.right - rect.left
                        - (GetSystemMetrics(SM_CXFRAME) +
-                           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
+                          GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
                     rect.bottom - rect.top
                        - (GetSystemMetrics(SM_CYFRAME) +
-                           GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
+                          GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
                        - GetSystemMetrics(SM_CYCAPTION)
 #ifdef FEAT_MENU
                        - gui_mswin_get_menu_height(FALSE)
index a3eabcf3fea176b354612db7ab13d6eba86db301..bc1e5550ca6e9b7ec5a35e10a88cf9d0d5dcb86c 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    869,
 /**/
     868,
 /**/