aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv2010-01-09 14:26:23 +0100
committerJan Djärv2010-01-09 14:26:23 +0100
commit21b9df2f5a971663ecbc363fe1a0663bf7e03c10 (patch)
tree53eed7208de2ea312c07ed83a0d6b152e42c99d5
parentde62c4d98f81fa1f960aa00765263accdb86a0ff (diff)
downloademacs-21b9df2f5a971663ecbc363fe1a0663bf7e03c10.tar.gz
emacs-21b9df2f5a971663ecbc363fe1a0663bf7e03c10.zip
(Fx_create_frame): Don't create frame larger than display by default bug#3643.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xfns.c39
2 files changed, 44 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 309c663d1ef..600ff8a5219 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-01-09 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xfns.c (Fx_create_frame): Don't create frame larger than display
4 by default bug#3643.
5
12010-01-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 62010-01-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 7
3 * frame.h (FRAME_TOP_MARGIN_HEIGHT): New macro. 8 * frame.h (FRAME_TOP_MARGIN_HEIGHT): New macro.
diff --git a/src/xfns.c b/src/xfns.c
index 572cf38e0c7..db42e005d75 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3396,6 +3396,45 @@ This function is an internal primitive--use `make-frame' instead. */)
3396 /* Compute the size of the X window. */ 3396 /* Compute the size of the X window. */
3397 window_prompting = x_figure_window_size (f, parms, 1); 3397 window_prompting = x_figure_window_size (f, parms, 1);
3398 3398
3399 /* Don't make height higher than display height unless the user asked
3400 for it. */
3401 height = FRAME_LINES (f);
3402 tem = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
3403 if (EQ (tem, Qunbound))
3404 {
3405 int ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
3406 int dph = DisplayHeight (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f));
3407 if (ph > dph)
3408 {
3409 height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, dph) -
3410 FRAME_TOOL_BAR_LINES (f) - FRAME_MENU_BAR_LINES (f);
3411 if (FRAME_EXTERNAL_TOOL_BAR (f))
3412 height -= 2; /* We can't know how big it will be. */
3413 if (FRAME_EXTERNAL_MENU_BAR (f))
3414 height -= 2; /* We can't know how big it will be. */
3415 }
3416 }
3417
3418 /* Don't make width wider than display width unless the user asked
3419 for it. */
3420 width = FRAME_COLS (f);
3421 tem = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
3422 if (EQ (tem, Qunbound))
3423 {
3424 int pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, FRAME_COLS (f));
3425 int dpw = DisplayWidth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f));
3426 if (pw > dpw)
3427 width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, dpw);
3428 }
3429
3430 if (height != FRAME_LINES (f) || width != FRAME_COLS (f))
3431 {
3432 check_frame_size (f, &height, &width);
3433 FRAME_LINES (f) = height;
3434 SET_FRAME_COLS (f, width);
3435 }
3436
3437
3399 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); 3438 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
3400 f->no_split = minibuffer_only || EQ (tem, Qt); 3439 f->no_split = minibuffer_only || EQ (tem, Qt);
3401 3440