Karsten Hopp 78a3e9
To: vim-dev@vim.org
Karsten Hopp 78a3e9
Subject: Patch 7.2.350
Karsten Hopp 78a3e9
Fcc: outbox
Karsten Hopp 78a3e9
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 78a3e9
Mime-Version: 1.0
Karsten Hopp 78a3e9
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 78a3e9
Content-Transfer-Encoding: 8bit
Karsten Hopp 78a3e9
------------
Karsten Hopp 78a3e9
Karsten Hopp 78a3e9
Patch 7.2.350
Karsten Hopp 78a3e9
Problem:    Win32: When changing font the window may jump from the secondary
Karsten Hopp 78a3e9
	    to the primary screen. (Michael Wookey)
Karsten Hopp 78a3e9
Solution:   When the screen position was negative don't correct it to zero.
Karsten Hopp 78a3e9
Files:	    src/gui.c
Karsten Hopp 78a3e9
Karsten Hopp 78a3e9
Karsten Hopp 78a3e9
*** ../vim-7.2.349/src/gui.c	2009-09-23 18:14:13.000000000 +0200
Karsten Hopp 78a3e9
--- src/gui.c	2010-01-27 21:02:32.000000000 +0100
Karsten Hopp 78a3e9
***************
Karsten Hopp 78a3e9
*** 1390,1395 ****
Karsten Hopp 78a3e9
--- 1390,1396 ----
Karsten Hopp 78a3e9
      int		un_maximize = mustset;
Karsten Hopp 78a3e9
      int         did_adjust = 0;
Karsten Hopp 78a3e9
  #endif
Karsten Hopp 78a3e9
+     int		x = -1, y = -1;
Karsten Hopp 78a3e9
  
Karsten Hopp 78a3e9
      if (!gui.shell_created)
Karsten Hopp 78a3e9
  	return;
Karsten Hopp 78a3e9
***************
Karsten Hopp 78a3e9
*** 1406,1411 ****
Karsten Hopp 78a3e9
--- 1407,1416 ----
Karsten Hopp 78a3e9
  
Karsten Hopp 78a3e9
      base_width = gui_get_base_width();
Karsten Hopp 78a3e9
      base_height = gui_get_base_height();
Karsten Hopp 78a3e9
+     if (fit_to_display)
Karsten Hopp 78a3e9
+ 	/* Remember the original window position. */
Karsten Hopp 78a3e9
+ 	gui_mch_get_winpos(&x, &y);
Karsten Hopp 78a3e9
+ 
Karsten Hopp 78a3e9
  #ifdef USE_SUN_WORKSHOP
Karsten Hopp 78a3e9
      if (!mustset && usingSunWorkShop
Karsten Hopp 78a3e9
  				&& workshop_get_width_height(&width, &height))
Karsten Hopp 78a3e9
***************
Karsten Hopp 78a3e9
*** 1473,1483 ****
Karsten Hopp 78a3e9
  
Karsten Hopp 78a3e9
      gui_mch_set_shellsize(width, height, min_width, min_height,
Karsten Hopp 78a3e9
  					  base_width, base_height, direction);
Karsten Hopp 78a3e9
-     if (fit_to_display)
Karsten Hopp 78a3e9
-     {
Karsten Hopp 78a3e9
- 	int	    x, y;
Karsten Hopp 78a3e9
  
Karsten Hopp 78a3e9
! 	/* Some window managers put the Vim window left of/above the screen. */
Karsten Hopp 78a3e9
  	gui_mch_update();
Karsten Hopp 78a3e9
  	if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0))
Karsten Hopp 78a3e9
  	    gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y);
Karsten Hopp 78a3e9
--- 1478,1489 ----
Karsten Hopp 78a3e9
  
Karsten Hopp 78a3e9
      gui_mch_set_shellsize(width, height, min_width, min_height,
Karsten Hopp 78a3e9
  					  base_width, base_height, direction);
Karsten Hopp 78a3e9
  
Karsten Hopp 78a3e9
!     if (fit_to_display && x >= 0 && y >= 0)
Karsten Hopp 78a3e9
!     {
Karsten Hopp 78a3e9
! 	/* Some window managers put the Vim window left of/above the screen.
Karsten Hopp 78a3e9
! 	 * Only change the position if it wasn't already negative before
Karsten Hopp 78a3e9
! 	 * (happens on MS-Windows with a secondary monitor). */
Karsten Hopp 78a3e9
  	gui_mch_update();
Karsten Hopp 78a3e9
  	if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0))
Karsten Hopp 78a3e9
  	    gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y);
Karsten Hopp 78a3e9
*** ../vim-7.2.349/src/version.c	2010-01-27 20:26:41.000000000 +0100
Karsten Hopp 78a3e9
--- src/version.c	2010-01-27 21:03:41.000000000 +0100
Karsten Hopp 78a3e9
***************
Karsten Hopp 78a3e9
*** 683,684 ****
Karsten Hopp 78a3e9
--- 683,686 ----
Karsten Hopp 78a3e9
  {   /* Add new patch number below this line */
Karsten Hopp 78a3e9
+ /**/
Karsten Hopp 78a3e9
+     350,
Karsten Hopp 78a3e9
  /**/
Karsten Hopp 78a3e9
Karsten Hopp 78a3e9
-- 
Karsten Hopp 78a3e9
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 78a3e9
160. You get in the elevator and double-click the button for the floor
Karsten Hopp 78a3e9
     you want.
Karsten Hopp 78a3e9
Karsten Hopp 78a3e9
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 78a3e9
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 78a3e9
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 78a3e9
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///