comparison src/frame.c @ 280:7df0dd720c89 r21-0b38

Import from CVS: tag r21-0b38
author cvs
date Mon, 13 Aug 2007 10:32:22 +0200
parents c5d627a313b1
children c42ec1d1cded
comparison
equal deleted inserted replaced
279:c20b2fb5bb0a 280:7df0dd720c89
414 if (!NILP (Fstring_match (make_string ((CONST Bufbyte *) "\\.", 2), name, 414 if (!NILP (Fstring_match (make_string ((CONST Bufbyte *) "\\.", 2), name,
415 Qnil, Qnil))) 415 Qnil, Qnil)))
416 signal_simple_error (". not allowed in frame names", name); 416 signal_simple_error (". not allowed in frame names", name);
417 417
418 f = allocate_frame_core (device); 418 f = allocate_frame_core (device);
419 XSETFRAME (frame, f);
419 420
420 specbind (Qframe_being_created, name); 421 specbind (Qframe_being_created, name);
421 f->name = name; 422 f->name = name;
422 423
423 FRAMEMETH (f, init_frame_1, (f, props)); 424 FRAMEMETH (f, init_frame_1, (f, props));
443 else if (EQ (minibuf, Qt) || UNBOUNDP (minibuf)) 444 else if (EQ (minibuf, Qt) || UNBOUNDP (minibuf))
444 setup_normal_frame (f); 445 setup_normal_frame (f);
445 else 446 else
446 signal_simple_error ("Invalid value for `minibuffer'", minibuf); 447 signal_simple_error ("Invalid value for `minibuffer'", minibuf);
447 448
448 XSETFRAME (frame, f);
449 update_frame_window_mirror (f); 449 update_frame_window_mirror (f);
450 450
451 if (initialized) 451 if (initialized)
452 { 452 {
453 if (!NILP (f->minibuffer_window)) 453 if (!NILP (f->minibuffer_window))
665 function is called. 665 function is called.
666 666
667 Note that this does not actually cause the window-system focus to 667 Note that this does not actually cause the window-system focus to
668 be set to this frame, or the select-frame-hook or deselect-frame-hook 668 be set to this frame, or the select-frame-hook or deselect-frame-hook
669 to be run, until the next time that XEmacs is waiting for an event. 669 to be run, until the next time that XEmacs is waiting for an event.
670
671 Also note that when focus-follows-mouse is non-nil, the frame
672 selection is temporary and is reverted when the current command
673 terminates, much like the buffer selected by `set-buffer'. In order
674 to effect a permanent focus change in this case, bind
675 focus-follows-mouse to nil, select the frame you want, and do
676 a (sit-for 0) within the scope of the binding.
670 */ 677 */
671 (frame)) 678 (frame))
672 { 679 {
673 CHECK_LIVE_FRAME (frame); 680 CHECK_LIVE_FRAME (frame);
674 681
1509 } 1516 }
1510 } 1517 }
1511 } 1518 }
1512 double_break_1: 1519 double_break_1:
1513 1520
1514 if (!called_from_delete_device) 1521 #if 0
1522 /* The following test is degenerate FALSE */
1523 if (called_from_delete_device < 0)
1515 /* then we're being called from delete-console, and we shouldn't 1524 /* then we're being called from delete-console, and we shouldn't
1516 try to find another default-minibuffer frame for the console. 1525 try to find another default-minibuffer frame for the console.
1517 */ 1526 */
1518 con->default_minibuffer_frame = Qnil; 1527 con->default_minibuffer_frame = Qnil;
1528 #endif
1519 1529
1520 /* If we've deleted this console's default_minibuffer_frame, try to 1530 /* If we've deleted this console's default_minibuffer_frame, try to
1521 find another one. Prefer minibuffer-only frames, but also notice 1531 find another one. Prefer minibuffer-only frames, but also notice
1522 frames with other windows. */ 1532 frames with other windows. */
1523 if (EQ (frame, con->default_minibuffer_frame)) 1533 if (EQ (frame, con->default_minibuffer_frame))
2739 new_pixheight += FRAME_SCROLLBAR_HEIGHT (f); 2749 new_pixheight += FRAME_SCROLLBAR_HEIGHT (f);
2740 new_pixwidth += FRAME_SCROLLBAR_WIDTH (f); 2750 new_pixwidth += FRAME_SCROLLBAR_WIDTH (f);
2741 } 2751 }
2742 2752
2743 /* when frame_conversion_internal() calculated the number of rows/cols 2753 /* when frame_conversion_internal() calculated the number of rows/cols
2744 in the frame, the toolbar sizes were subtracted out. However, 2754 in the frame, the theoretical toolbar sizes were subtracted out.
2745 if the corresponding toolbar is not actually visible in the 2755 The caluclations below adjust for real toolbar height/width in
2746 selected window, then the extra space needs to be filled in 2756 frame, which may be different from frame spec, taking the above
2747 with rows/cols. */ 2757 fact into account */
2748 if (!FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) 2758 new_pixheight +=
2749 new_pixheight += FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f) + 2759 + FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT (f)
2750 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f); 2760 + 2 * FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH (f)
2751 if (!FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE (f)) 2761 - FRAME_REAL_TOP_TOOLBAR_HEIGHT (f)
2752 new_pixheight += FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f) + 2762 - 2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f);
2753 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f); 2763
2754 if (!FRAME_REAL_LEFT_TOOLBAR_VISIBLE (f)) 2764 new_pixheight +=
2755 new_pixwidth += FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f) + 2765 + FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT (f)
2756 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f); 2766 + 2 * FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f)
2757 if (!FRAME_REAL_RIGHT_TOOLBAR_VISIBLE (f)) 2767 - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f)
2758 new_pixwidth += FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f) + 2768 - 2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f);
2759 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f); 2769
2760 2770 new_pixwidth +=
2771 + FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH (f)
2772 + 2 * FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH (f)
2773 - FRAME_REAL_LEFT_TOOLBAR_WIDTH (f)
2774 - 2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f);
2775
2776 new_pixwidth +=
2777 + FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH (f)
2778 + 2 * FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH (f)
2779 - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f)
2780 - 2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f);
2781
2761 /* Adjust the width for the end glyph which may be a different width 2782 /* Adjust the width for the end glyph which may be a different width
2762 than the default character width. */ 2783 than the default character width. */
2763 { 2784 {
2764 int adjustment, trunc_width, cont_width; 2785 int adjustment, trunc_width, cont_width;
2765 2786