aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-03-11 23:38:27 +0000
committerKarl Heuer1994-03-11 23:38:27 +0000
commit96a410bce6167f4ba9be55693dee79075325893e (patch)
tree237557f97d8d27a590fc795c9d0d42da304cd0ca /src
parent165e1749b20e7caf149c725db3737a275c3d3170 (diff)
downloademacs-96a410bce6167f4ba9be55693dee79075325893e.tar.gz
emacs-96a410bce6167f4ba9be55693dee79075325893e.zip
(x_consider_frame_title): New function, extracted from display_mode_line.
(redisplay): Update frame title on iconified frames.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c51
1 files changed, 34 insertions, 17 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index d2e5966049a..1c8158a80f2 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -427,6 +427,34 @@ echo_area_display ()
427 427
428 previous_echo_glyphs = echo_area_glyphs; 428 previous_echo_glyphs = echo_area_glyphs;
429} 429}
430
431#ifdef HAVE_X_WINDOWS
432/* I'm trying this out because I saw Unimpress use it, but it's
433 possible that this may mess adversely with some window managers. -jla
434
435 Wouldn't it be nice to use something like mode-line-format to
436 describe frame titles? -JimB */
437
438/* Change the title of the frame to the name of the buffer displayed
439 in the currently selected window. Don't do this for minibuffer frames,
440 and don't do it when there's only one non-minibuffer frame. */
441static void
442x_consider_frame_title (frame)
443 Lisp_Object frame;
444{
445 FRAME_PTR f = XFRAME (frame);
446
447 if (FRAME_X_P (f) && ! FRAME_MINIBUF_ONLY_P (f))
448 {
449 Lisp_Object title = Qnil;
450
451 if (! EQ (Fnext_frame (frame, Qnil), frame))
452 title = XBUFFER (XWINDOW (f->selected_window)->buffer)->name;
453
454 x_implicitly_set_name (f, title, Qnil);
455 }
456}
457#endif
430 458
431/* Prepare for redisplay by updating menu-bar item lists when appropriate. 459/* Prepare for redisplay by updating menu-bar item lists when appropriate.
432 This can't be done in `redisplay' itself because it can call eval. */ 460 This can't be done in `redisplay' itself because it can call eval. */
@@ -705,6 +733,10 @@ redisplay ()
705 733
706 if (FRAME_VISIBLE_P (f)) 734 if (FRAME_VISIBLE_P (f))
707 redisplay_windows (FRAME_ROOT_WINDOW (f)); 735 redisplay_windows (FRAME_ROOT_WINDOW (f));
736#ifdef HAVE_X_WINDOWS
737 else if (FRAME_ICONIFIED_P (f))
738 x_consider_frame_title (frame);
739#endif
708 740
709 /* Any scroll bars which redisplay_windows should have nuked 741 /* Any scroll bars which redisplay_windows should have nuked
710 should now go away. */ 742 should now go away. */
@@ -2471,23 +2503,8 @@ display_mode_line (w)
2471 } 2503 }
2472 2504
2473#ifdef HAVE_X_WINDOWS 2505#ifdef HAVE_X_WINDOWS
2474 /* I'm trying this out because I saw Unimpress use it, but it's 2506 if (w == XWINDOW (f->selected_window))
2475 possible that this may mess adversely with some window managers. -jla 2507 x_consider_frame_title (WINDOW_FRAME (w));
2476
2477 Wouldn't it be nice to use something like mode-line-format to
2478 describe frame titles? -JimB */
2479
2480 /* Change the title of the frame to the name of the buffer displayed
2481 in the currently selected window. Don't do this for minibuffer frames,
2482 and don't do it when there's only one non-minibuffer frame. */
2483 if (FRAME_X_P (f)
2484 && ! FRAME_MINIBUF_ONLY_P (f)
2485 && w == XWINDOW (f->selected_window))
2486 x_implicitly_set_name (f, (EQ (Fnext_frame (WINDOW_FRAME (w), Qnil),
2487 WINDOW_FRAME (w))
2488 ? Qnil
2489 : XBUFFER (w->buffer)->name),
2490 Qnil);
2491#endif 2508#endif
2492} 2509}
2493 2510