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