comparison src/gui.c @ 1967:4f3857aa1785 v7.2.264

updated for version 7.2-264
author vimboss
date Wed, 23 Sep 2009 16:14:49 +0000
parents 96276cc11d8e
children 9b78bb3794ba
comparison
equal deleted inserted replaced
1966:43a60ac87145 1967:4f3857aa1785
1384 int height; 1384 int height;
1385 int min_width; 1385 int min_width;
1386 int min_height; 1386 int min_height;
1387 int screen_w; 1387 int screen_w;
1388 int screen_h; 1388 int screen_h;
1389 #ifdef HAVE_GTK2
1390 int un_maximize = mustset;
1391 int did_adjust = 0;
1392 #endif
1389 1393
1390 if (!gui.shell_created) 1394 if (!gui.shell_created)
1391 return; 1395 return;
1392 1396
1393 #ifdef MSWIN 1397 #ifdef MSWIN
1423 { 1427 {
1424 Columns = (screen_w - base_width) / gui.char_width; 1428 Columns = (screen_w - base_width) / gui.char_width;
1425 if (Columns < MIN_COLUMNS) 1429 if (Columns < MIN_COLUMNS)
1426 Columns = MIN_COLUMNS; 1430 Columns = MIN_COLUMNS;
1427 width = Columns * gui.char_width + base_width; 1431 width = Columns * gui.char_width + base_width;
1432 #ifdef HAVE_GTK2
1433 ++did_adjust;
1434 #endif
1428 } 1435 }
1429 if ((direction & RESIZE_VERT) && height > screen_h) 1436 if ((direction & RESIZE_VERT) && height > screen_h)
1430 { 1437 {
1431 Rows = (screen_h - base_height) / gui.char_height; 1438 Rows = (screen_h - base_height) / gui.char_height;
1432 check_shellsize(); 1439 check_shellsize();
1433 height = Rows * gui.char_height + base_height; 1440 height = Rows * gui.char_height + base_height;
1434 } 1441 #ifdef HAVE_GTK2
1442 ++did_adjust;
1443 #endif
1444 }
1445 #ifdef HAVE_GTK2
1446 if (did_adjust == 2 || (width + gui.char_width >= screen_w
1447 && height + gui.char_height >= screen_h))
1448 /* don't unmaximize if at maximum size */
1449 un_maximize = FALSE;
1450 #endif
1435 } 1451 }
1436 gui.num_cols = Columns; 1452 gui.num_cols = Columns;
1437 gui.num_rows = Rows; 1453 gui.num_rows = Rows;
1438 1454
1439 min_width = base_width + MIN_COLUMNS * gui.char_width; 1455 min_width = base_width + MIN_COLUMNS * gui.char_width;
1440 min_height = base_height + MIN_LINES * gui.char_height; 1456 min_height = base_height + MIN_LINES * gui.char_height;
1441 # ifdef FEAT_WINDOWS 1457 #ifdef FEAT_WINDOWS
1442 min_height += tabline_height() * gui.char_height; 1458 min_height += tabline_height() * gui.char_height;
1443 # endif 1459 #endif
1460
1461 #ifdef HAVE_GTK2
1462 if (un_maximize)
1463 {
1464 /* If the window size is smaller than the screen unmaximize the
1465 * window, otherwise resizing won't work. */
1466 gui_mch_get_screen_dimensions(&screen_w, &screen_h);
1467 if ((width + gui.char_width < screen_w
1468 || height + gui.char_height * 2 < screen_h)
1469 && gui_mch_maximized())
1470 gui_mch_unmaximize();
1471 }
1472 #endif
1444 1473
1445 gui_mch_set_shellsize(width, height, min_width, min_height, 1474 gui_mch_set_shellsize(width, height, min_width, min_height,
1446 base_width, base_height, direction); 1475 base_width, base_height, direction);
1447 if (fit_to_display) 1476 if (fit_to_display)
1448 { 1477 {