aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2010-01-25 08:43:10 +0100
committerJan Djärv2010-01-25 08:43:10 +0100
commit844794c855d15300f026a1ef4e114314ed87c2b2 (patch)
tree1387ffc3768c68f0fbbfea50bbfb1cff364ec862
parenta4cf170db540996460abefee7aab4e66b8b1b4d7 (diff)
downloademacs-844794c855d15300f026a1ef4e114314ed87c2b2.tar.gz
emacs-844794c855d15300f026a1ef4e114314ed87c2b2.zip
xfns.c (Fx_create_frame): If frame height i stoo big, try
sizes 24 and 10. Bug #3643.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xfns.c26
2 files changed, 22 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bdbdd0b0da9..bda2aa6d045 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-01-25 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xfns.c (Fx_create_frame): If frame height i stoo big, try
4 sizes 24 and 10. Bug #3643.
5
12010-01-20 Kenichi Handa <handa@m17n.org> 62010-01-20 Kenichi Handa <handa@m17n.org>
2 7
3 * coding.c (consume_chars): If ! multibyte and the encoder is ccl, 8 * coding.c (consume_chars): If ! multibyte and the encoder is ccl,
diff --git a/src/xfns.c b/src/xfns.c
index 6f18e4e813a..905ed9c576a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3518,27 +3518,35 @@ This function is an internal primitive--use `make-frame' instead. */)
3518 window_prompting = x_figure_window_size (f, parms, 1); 3518 window_prompting = x_figure_window_size (f, parms, 1);
3519 3519
3520 /* Don't make height higher than display height unless the user asked 3520 /* Don't make height higher than display height unless the user asked
3521 for it. */ 3521 for it. Try sizes 24 and 10 if current is too large. */
3522 height = FRAME_LINES (f); 3522 height = FRAME_LINES (f);
3523 tem = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER); 3523 tem = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
3524 if (EQ (tem, Qunbound)) 3524 if (EQ (tem, Qunbound))
3525 { 3525 {
3526 int ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f)); 3526 int h = FRAME_LINES (f) + FRAME_TOOL_BAR_LINES (f)
3527 + FRAME_MENU_BAR_LINES (f) + 2;
3528 int ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, h);
3527 int dph = DisplayHeight (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)); 3529 int dph = DisplayHeight (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f));
3530 static int tryheight[] = { 24, 10, 0 } ;
3531 int i;
3532
3533 ph += (FRAME_EXTERNAL_TOOL_BAR (f) ? 32 : 0) /* Gtk toolbar size */
3534 + (FRAME_EXTERNAL_MENU_BAR (f) ? 24 : 0); /* Arbitrary */
3535
3528 /* Some desktops have fixed menus above and/or panels below. Try to 3536 /* Some desktops have fixed menus above and/or panels below. Try to
3529 figure out the usable size we have for emacs. */ 3537 figure out the usable size we have for emacs. */
3530 current_desktop = x_get_current_desktop (f); 3538 current_desktop = x_get_current_desktop (f);
3531 x_get_desktop_workarea (f, current_desktop, &deskw, &deskh); 3539 x_get_desktop_workarea (f, current_desktop, &deskw, &deskh);
3532 if (deskh > 0 && deskh < dph) dph = deskh; 3540 if (deskh > 0 && deskh < dph) dph = deskh;
3533 3541
3534 if (ph > dph) 3542 /* Allow 40 pixels for manager decorations. */
3543 for (i = 0; ph+40 > dph && tryheight[i] != 0; ++i)
3535 { 3544 {
3536 height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, dph) - 3545 height = tryheight[i];
3537 FRAME_TOOL_BAR_LINES (f) - FRAME_MENU_BAR_LINES (f); 3546 h = height + FRAME_TOOL_BAR_LINES (f) + FRAME_MENU_BAR_LINES (f) + 2;
3538 if (FRAME_EXTERNAL_TOOL_BAR (f)) 3547 ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, h)
3539 height -= 2; /* We can't know how big it will be. */ 3548 + (FRAME_EXTERNAL_TOOL_BAR (f) ? 32 : 0)
3540 if (FRAME_EXTERNAL_MENU_BAR (f)) 3549 + (FRAME_EXTERNAL_MENU_BAR (f) ? 24 : 0);
3541 height -= 2; /* We can't know how big it will be. */
3542 } 3550 }
3543 } 3551 }
3544 3552