comparison src/frame-x.c @ 269:b2472a1930f2 r20-5b33

Import from CVS: tag r20-5b33
author cvs
date Mon, 13 Aug 2007 10:27:19 +0200
parents 0e522484dd2a
children c5d627a313b1
comparison
equal deleted inserted replaced
268:6ced69ccd85f 269:b2472a1930f2
2556 xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f)); 2556 xfree (FRAME_X_GEOM_FREE_ME_PLEASE (f));
2557 xfree (f->frame_data); 2557 xfree (f->frame_data);
2558 f->frame_data = 0; 2558 f->frame_data = 0;
2559 } 2559 }
2560 2560
2561 static void
2562 x_update_frame_external_traits (struct frame* frm, Lisp_Object name)
2563 {
2564 Arg av[10];
2565 int ac = 0;
2566 Lisp_Object frame = Qnil;
2567
2568 XSETFRAME(frame, frm);
2569
2570 if (EQ (name, Qforeground))
2571 {
2572 Lisp_Object color = FACE_FOREGROUND (Vdefault_face, frame);
2573 XColor fgc;
2574
2575 if (!EQ (color, Vthe_null_color_instance))
2576 {
2577 fgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
2578 XtSetArg (av[ac], XtNforeground, (void *) fgc.pixel); ac++;
2579 }
2580 }
2581 else if (EQ (name, Qbackground))
2582 {
2583 Lisp_Object color = FACE_BACKGROUND (Vdefault_face, frame);
2584 XColor bgc;
2585
2586 if (!EQ (color, Vthe_null_color_instance))
2587 {
2588 bgc = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (color));
2589 XtSetArg (av[ac], XtNbackground, (void *) bgc.pixel); ac++;
2590 }
2591
2592 /* Really crappy way to force the modeline shadows to be
2593 redrawn. But effective. */
2594 MARK_FRAME_WINDOWS_STRUCTURE_CHANGED (frm);
2595 MARK_FRAME_CHANGED (frm);
2596 }
2597 else if (EQ (name, Qfont))
2598 {
2599 Lisp_Object font = FACE_FONT (Vdefault_face, frame, Vcharset_ascii);
2600
2601 if (!EQ (font, Vthe_null_font_instance))
2602 XtSetArg (av[ac], XtNfont,
2603 (void *) FONT_INSTANCE_X_FONT (XFONT_INSTANCE (font)));
2604 ac++;
2605 }
2606 else
2607 abort ();
2608
2609 XtSetValues (FRAME_X_TEXT_WIDGET (frm), av, ac);
2610
2611 #ifdef HAVE_TOOLBARS
2612 /* Setting the background clears the entire frame area
2613 including the toolbar so we force an immediate redraw of
2614 it. */
2615 if (EQ (name, Qbackground))
2616 MAYBE_DEVMETH (XDEVICE (frm->device), redraw_frame_toolbars, (frm));
2617 #endif /* HAVE_TOOLBARS */
2618
2619 /* The intent of this code is to cause the frame size in
2620 characters to remain the same when the font changes, at the
2621 expense of changing the frame size in pixels. It's not
2622 totally clear that this is the right thing to do, but it's
2623 not clearly wrong either. */
2624 if (EQ (name, Qfont))
2625 {
2626 EmacsFrameRecomputeCellSize (FRAME_X_TEXT_WIDGET (frm));
2627 Fset_frame_size (frame,
2628 make_int (frm->width),
2629 make_int (frm->height),
2630 Qnil);
2631 }
2632 }
2633
2561 2634
2562 /************************************************************************/ 2635 /************************************************************************/
2563 /* initialization */ 2636 /* initialization */
2564 /************************************************************************/ 2637 /************************************************************************/
2565 2638
2608 CONSOLE_HAS_METHOD (x, frame_totally_visible_p); 2681 CONSOLE_HAS_METHOD (x, frame_totally_visible_p);
2609 CONSOLE_HAS_METHOD (x, frame_iconified_p); 2682 CONSOLE_HAS_METHOD (x, frame_iconified_p);
2610 CONSOLE_HAS_METHOD (x, set_frame_pointer); 2683 CONSOLE_HAS_METHOD (x, set_frame_pointer);
2611 CONSOLE_HAS_METHOD (x, set_frame_icon); 2684 CONSOLE_HAS_METHOD (x, set_frame_icon);
2612 CONSOLE_HAS_METHOD (x, get_frame_parent); 2685 CONSOLE_HAS_METHOD (x, get_frame_parent);
2686 CONSOLE_HAS_METHOD (x, update_frame_external_traits);
2613 } 2687 }
2614 2688
2615 void 2689 void
2616 vars_of_frame_x (void) 2690 vars_of_frame_x (void)
2617 { 2691 {