]> granicus.if.org Git - vim/commitdiff
updated for version 7.2.350 v7.2.350
authorBram Moolenaar <Bram@vim.org>
Wed, 27 Jan 2010 20:05:05 +0000 (21:05 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 27 Jan 2010 20:05:05 +0000 (21:05 +0100)
Problem:    Win32: When changing font the window may jump from the secondary
            to the primary screen. (Michael Wookey)
Solution:   When the screen position was negative don't correct it to zero.

src/gui.c
src/version.c

index 48e7b0fb08615e73b0b28e01100b2357dcec8de5..2c307faaaadab988072207fa02c0fd2d8953e849 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -1390,6 +1390,7 @@ gui_set_shellsize(mustset, fit_to_display, direction)
     int                un_maximize = mustset;
     int         did_adjust = 0;
 #endif
+    int                x = -1, y = -1;
 
     if (!gui.shell_created)
        return;
@@ -1406,6 +1407,10 @@ gui_set_shellsize(mustset, fit_to_display, direction)
 
     base_width = gui_get_base_width();
     base_height = gui_get_base_height();
+    if (fit_to_display)
+       /* Remember the original window position. */
+       gui_mch_get_winpos(&x, &y);
+
 #ifdef USE_SUN_WORKSHOP
     if (!mustset && usingSunWorkShop
                                && workshop_get_width_height(&width, &height))
@@ -1473,11 +1478,12 @@ gui_set_shellsize(mustset, fit_to_display, direction)
 
     gui_mch_set_shellsize(width, height, min_width, min_height,
                                          base_width, base_height, direction);
-    if (fit_to_display)
-    {
-       int         x, y;
 
-       /* Some window managers put the Vim window left of/above the screen. */
+    if (fit_to_display && x >= 0 && y >= 0)
+    {
+       /* Some window managers put the Vim window left of/above the screen.
+        * Only change the position if it wasn't already negative before
+        * (happens on MS-Windows with a secondary monitor). */
        gui_mch_update();
        if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0))
            gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y);
index 2fbee777eb018e1d014e6c05164887457862ec50..7e39961af1f71a87daf0302a454648a83fb187a2 100644 (file)
@@ -681,6 +681,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    350,
 /**/
     349,
 /**/