Karsten Hopp a584b0
To: vim_dev@googlegroups.com
Karsten Hopp a584b0
Subject: Patch 7.4.869
Karsten Hopp a584b0
Fcc: outbox
Karsten Hopp a584b0
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp a584b0
Mime-Version: 1.0
Karsten Hopp a584b0
Content-Type: text/plain; charset=UTF-8
Karsten Hopp a584b0
Content-Transfer-Encoding: 8bit
Karsten Hopp a584b0
------------
Karsten Hopp a584b0
Karsten Hopp a584b0
Patch 7.4.869
Karsten Hopp a584b0
Problem:    MS-Windows: scrolling may cause text to disappear when using an
Karsten Hopp a584b0
            Intel GPU.
Karsten Hopp a584b0
Solution:   Call GetPixel(). (Yohei Endo)
Karsten Hopp a584b0
Files:      src/gui_w48.c
Karsten Hopp a584b0
Karsten Hopp a584b0
Karsten Hopp a584b0
*** ../vim-7.4.868/src/gui_w48.c	2015-09-15 14:12:01.382632522 +0200
Karsten Hopp a584b0
--- src/gui_w48.c	2015-09-15 17:57:35.316887514 +0200
Karsten Hopp a584b0
***************
Karsten Hopp a584b0
*** 2389,2395 ****
Karsten Hopp a584b0
  	return;
Karsten Hopp a584b0
  
Karsten Hopp a584b0
      if (first_tabpage->tp_next != NULL)
Karsten Hopp a584b0
!         add_tabline_popup_menu_entry(tab_pmenu,
Karsten Hopp a584b0
  					  TABLINE_MENU_CLOSE, _("Close tab"));
Karsten Hopp a584b0
      add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
Karsten Hopp a584b0
      add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
Karsten Hopp a584b0
--- 2389,2395 ----
Karsten Hopp a584b0
  	return;
Karsten Hopp a584b0
  
Karsten Hopp a584b0
      if (first_tabpage->tp_next != NULL)
Karsten Hopp a584b0
! 	add_tabline_popup_menu_entry(tab_pmenu,
Karsten Hopp a584b0
  					  TABLINE_MENU_CLOSE, _("Close tab"));
Karsten Hopp a584b0
      add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
Karsten Hopp a584b0
      add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
Karsten Hopp a584b0
***************
Karsten Hopp a584b0
*** 2931,2940 ****
Karsten Hopp a584b0
  
Karsten Hopp a584b0
      base_width = gui_get_base_width()
Karsten Hopp a584b0
  	+ (GetSystemMetrics(SM_CXFRAME) +
Karsten Hopp a584b0
!            GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
Karsten Hopp a584b0
      base_height = gui_get_base_height()
Karsten Hopp a584b0
  	+ (GetSystemMetrics(SM_CYFRAME) +
Karsten Hopp a584b0
!            GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
Karsten Hopp a584b0
  	+ GetSystemMetrics(SM_CYCAPTION)
Karsten Hopp a584b0
  #ifdef FEAT_MENU
Karsten Hopp a584b0
  	+ gui_mswin_get_menu_height(FALSE)
Karsten Hopp a584b0
--- 2931,2940 ----
Karsten Hopp a584b0
  
Karsten Hopp a584b0
      base_width = gui_get_base_width()
Karsten Hopp a584b0
  	+ (GetSystemMetrics(SM_CXFRAME) +
Karsten Hopp a584b0
! 	   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2;
Karsten Hopp a584b0
      base_height = gui_get_base_height()
Karsten Hopp a584b0
  	+ (GetSystemMetrics(SM_CYFRAME) +
Karsten Hopp a584b0
! 	   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
Karsten Hopp a584b0
  	+ GetSystemMetrics(SM_CYCAPTION)
Karsten Hopp a584b0
  #ifdef FEAT_MENU
Karsten Hopp a584b0
  	+ gui_mswin_get_menu_height(FALSE)
Karsten Hopp a584b0
***************
Karsten Hopp a584b0
*** 2997,3002 ****
Karsten Hopp a584b0
--- 2997,3016 ----
Karsten Hopp a584b0
  }
Karsten Hopp a584b0
  
Karsten Hopp a584b0
  /*
Karsten Hopp a584b0
+  * On some Intel GPUs, the regions drawn just prior to ScrollWindowEx()
Karsten Hopp a584b0
+  * may not be scrolled out properly.
Karsten Hopp a584b0
+  * For gVim, when _OnScroll() is repeated, the character at the
Karsten Hopp a584b0
+  * previous cursor position may be left drawn after scroll.
Karsten Hopp a584b0
+  * The problem can be avoided by calling GetPixel() to get a pixel in
Karsten Hopp a584b0
+  * the region before ScrollWindowEx().
Karsten Hopp a584b0
+  */
Karsten Hopp a584b0
+     static void
Karsten Hopp a584b0
+ intel_gpu_workaround(void)
Karsten Hopp a584b0
+ {
Karsten Hopp a584b0
+     GetPixel(s_hdc, FILL_X(gui.col), FILL_Y(gui.row));
Karsten Hopp a584b0
+ }
Karsten Hopp a584b0
+ 
Karsten Hopp a584b0
+ /*
Karsten Hopp a584b0
   * Delete the given number of lines from the given row, scrolling up any
Karsten Hopp a584b0
   * text further down within the scroll region.
Karsten Hopp a584b0
   */
Karsten Hopp a584b0
***************
Karsten Hopp a584b0
*** 3007,3012 ****
Karsten Hopp a584b0
--- 3021,3028 ----
Karsten Hopp a584b0
  {
Karsten Hopp a584b0
      RECT	rc;
Karsten Hopp a584b0
  
Karsten Hopp a584b0
+     intel_gpu_workaround();
Karsten Hopp a584b0
+ 
Karsten Hopp a584b0
      rc.left = FILL_X(gui.scroll_region_left);
Karsten Hopp a584b0
      rc.right = FILL_X(gui.scroll_region_right + 1);
Karsten Hopp a584b0
      rc.top = FILL_Y(row);
Karsten Hopp a584b0
***************
Karsten Hopp a584b0
*** 3038,3043 ****
Karsten Hopp a584b0
--- 3054,3061 ----
Karsten Hopp a584b0
  {
Karsten Hopp a584b0
      RECT	rc;
Karsten Hopp a584b0
  
Karsten Hopp a584b0
+     intel_gpu_workaround();
Karsten Hopp a584b0
+ 
Karsten Hopp a584b0
      rc.left = FILL_X(gui.scroll_region_left);
Karsten Hopp a584b0
      rc.right = FILL_X(gui.scroll_region_right + 1);
Karsten Hopp a584b0
      rc.top = FILL_Y(row);
Karsten Hopp a584b0
***************
Karsten Hopp a584b0
*** 3319,3328 ****
Karsten Hopp a584b0
      GetWindowRect(s_hwnd, &rect);
Karsten Hopp a584b0
      gui_resize_shell(rect.right - rect.left
Karsten Hopp a584b0
  			- (GetSystemMetrics(SM_CXFRAME) +
Karsten Hopp a584b0
!                            GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
Karsten Hopp a584b0
  		     rect.bottom - rect.top
Karsten Hopp a584b0
  			- (GetSystemMetrics(SM_CYFRAME) +
Karsten Hopp a584b0
!                            GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
Karsten Hopp a584b0
  			- GetSystemMetrics(SM_CYCAPTION)
Karsten Hopp a584b0
  #ifdef FEAT_MENU
Karsten Hopp a584b0
  			- gui_mswin_get_menu_height(FALSE)
Karsten Hopp a584b0
--- 3337,3346 ----
Karsten Hopp a584b0
      GetWindowRect(s_hwnd, &rect);
Karsten Hopp a584b0
      gui_resize_shell(rect.right - rect.left
Karsten Hopp a584b0
  			- (GetSystemMetrics(SM_CXFRAME) +
Karsten Hopp a584b0
! 			   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2,
Karsten Hopp a584b0
  		     rect.bottom - rect.top
Karsten Hopp a584b0
  			- (GetSystemMetrics(SM_CYFRAME) +
Karsten Hopp a584b0
! 			   GetSystemMetrics(SM_CXPADDEDBORDER)) * 2
Karsten Hopp a584b0
  			- GetSystemMetrics(SM_CYCAPTION)
Karsten Hopp a584b0
  #ifdef FEAT_MENU
Karsten Hopp a584b0
  			- gui_mswin_get_menu_height(FALSE)
Karsten Hopp a584b0
*** ../vim-7.4.868/src/version.c	2015-09-15 17:30:35.913682004 +0200
Karsten Hopp a584b0
--- src/version.c	2015-09-15 17:55:53.009950236 +0200
Karsten Hopp a584b0
***************
Karsten Hopp a584b0
*** 743,744 ****
Karsten Hopp a584b0
--- 743,746 ----
Karsten Hopp a584b0
  {   /* Add new patch number below this line */
Karsten Hopp a584b0
+ /**/
Karsten Hopp a584b0
+     869,
Karsten Hopp a584b0
  /**/
Karsten Hopp a584b0
Karsten Hopp a584b0
-- 
Karsten Hopp a584b0
Lower life forms have more fun!
Karsten Hopp a584b0
Karsten Hopp a584b0
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp a584b0
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp a584b0
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp a584b0
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///