comparison src/gui.c @ 2065:9b78bb3794ba v7.2.350

updated for version 7.2.350 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.
author Bram Moolenaar <bram@zimbu.org>
date Wed, 27 Jan 2010 21:05:05 +0100
parents 4f3857aa1785
children c6f1aa1e9f32
comparison
equal deleted inserted replaced
2064:f398e0cc5b7a 2065:9b78bb3794ba
1388 int screen_h; 1388 int screen_h;
1389 #ifdef HAVE_GTK2 1389 #ifdef HAVE_GTK2
1390 int un_maximize = mustset; 1390 int un_maximize = mustset;
1391 int did_adjust = 0; 1391 int did_adjust = 0;
1392 #endif 1392 #endif
1393 int x = -1, y = -1;
1393 1394
1394 if (!gui.shell_created) 1395 if (!gui.shell_created)
1395 return; 1396 return;
1396 1397
1397 #ifdef MSWIN 1398 #ifdef MSWIN
1404 } 1405 }
1405 #endif 1406 #endif
1406 1407
1407 base_width = gui_get_base_width(); 1408 base_width = gui_get_base_width();
1408 base_height = gui_get_base_height(); 1409 base_height = gui_get_base_height();
1410 if (fit_to_display)
1411 /* Remember the original window position. */
1412 gui_mch_get_winpos(&x, &y);
1413
1409 #ifdef USE_SUN_WORKSHOP 1414 #ifdef USE_SUN_WORKSHOP
1410 if (!mustset && usingSunWorkShop 1415 if (!mustset && usingSunWorkShop
1411 && workshop_get_width_height(&width, &height)) 1416 && workshop_get_width_height(&width, &height))
1412 { 1417 {
1413 Columns = (width - base_width + gui.char_width - 1) / gui.char_width; 1418 Columns = (width - base_width + gui.char_width - 1) / gui.char_width;
1471 } 1476 }
1472 #endif 1477 #endif
1473 1478
1474 gui_mch_set_shellsize(width, height, min_width, min_height, 1479 gui_mch_set_shellsize(width, height, min_width, min_height,
1475 base_width, base_height, direction); 1480 base_width, base_height, direction);
1476 if (fit_to_display) 1481
1477 { 1482 if (fit_to_display && x >= 0 && y >= 0)
1478 int x, y; 1483 {
1479 1484 /* Some window managers put the Vim window left of/above the screen.
1480 /* Some window managers put the Vim window left of/above the screen. */ 1485 * Only change the position if it wasn't already negative before
1486 * (happens on MS-Windows with a secondary monitor). */
1481 gui_mch_update(); 1487 gui_mch_update();
1482 if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0)) 1488 if (gui_mch_get_winpos(&x, &y) == OK && (x < 0 || y < 0))
1483 gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y); 1489 gui_mch_set_winpos(x < 0 ? 0 : x, y < 0 ? 0 : y);
1484 } 1490 }
1485 1491