emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 844b894: * src/xdisp.c (wset_update_mode_line): Move from `src/wi


From: Stefan Monnier
Subject: master 844b894: * src/xdisp.c (wset_update_mode_line): Move from `src/window.c`
Date: Tue, 13 Apr 2021 23:55:55 -0400 (EDT)

branch: master
commit 844b8949a71f180d395a237c768b22d91cf91ded
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * src/xdisp.c (wset_update_mode_line): Move from `src/window.c`
    
    Move that function next to its siblings.  Also simplify it, since
    after careful analysis it is now clear that the frame's title's update
    is already handled elsewhere (in `prepare_menu_bars` and `redisplay_window`)
    so we just need to make sure the `redisplay` bit is set.
    
    * src/window.c (wset_update_mode_line): Move to `src/xdisp.c`.
    * src/window.h (wset_update_mode_line): Declare.
---
 src/window.c | 14 --------------
 src/window.h |  1 +
 src/xdisp.c  | 12 ++++++++++++
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/src/window.c b/src/window.c
index 4d5c7e7..caf9df6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -215,20 +215,6 @@ wset_combination (struct window *w, bool horflag, 
Lisp_Object val)
     w->horizontal = horflag;
 }
 
-static void
-wset_update_mode_line (struct window *w)
-{
-  /* If this window is the selected window on its frame, set the
-     global variable update_mode_lines, so that gui_consider_frame_title
-     will consider this frame's title for redisplay.  */
-  Lisp_Object fselected_window = XFRAME (WINDOW_FRAME (w))->selected_window;
-
-  if (WINDOWP (fselected_window) && XWINDOW (fselected_window) == w)
-    update_mode_lines = 42;
-  else
-    w->update_mode_line = true;
-}
-
 /* True if leaf window W doesn't reflect the actual state
    of displayed buffer due to its text or overlays change.  */
 
diff --git a/src/window.h b/src/window.h
index b6f88e8..2400c42 100644
--- a/src/window.h
+++ b/src/window.h
@@ -1141,6 +1141,7 @@ extern void wset_redisplay (struct window *w);
 extern void fset_redisplay (struct frame *f);
 extern void bset_redisplay (struct buffer *b);
 extern void bset_update_mode_line (struct buffer *b);
+extern void wset_update_mode_line (struct window *w);
 /* Call this to tell redisplay to look for other windows than selected-window
    that need to be redisplayed.  Calling one of the *set_redisplay functions
    above already does it, so it's only needed in unusual cases.  */
diff --git a/src/xdisp.c b/src/xdisp.c
index 8f71803..9e55166 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -869,6 +869,18 @@ bset_update_mode_line (struct buffer *b)
   b->text->redisplay = true;
 }
 
+void
+wset_update_mode_line (struct window *w)
+{
+  w->update_mode_line = true;
+  /* When a window's mode line needs to be updated, the window's frame's
+     title may also need to be updated, but we don't need to worry about it
+     here.  Instead, `gui_consider_frame_title` is automatically called
+     whenever w->update_mode_line is set for that frame's selected window.
+     But for this to work reliably, we have to make sure the window
+     is considered, so we have to mark it for redisplay.  */
+  wset_redisplay (w); }
+
 DEFUN ("set-buffer-redisplay", Fset_buffer_redisplay,
        Sset_buffer_redisplay, 4, 4, 0,
        doc: /* Mark the current buffer for redisplay.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]