summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-04-13 23:55:47 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2021-04-13 23:55:47 -0400
commit844b8949a71f180d395a237c768b22d91cf91ded (patch)
tree336a7fb79a67d1729a456c837dffa6406eda375e
parent839a9e74e0263f4e75a0c34df39c2e0a57c49438 (diff)
downloademacs-844b8949a71f180d395a237c768b22d91cf91ded.tar.gz
emacs-844b8949a71f180d395a237c768b22d91cf91ded.tar.bz2
emacs-844b8949a71f180d395a237c768b22d91cf91ded.zip
* 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.
-rw-r--r--src/window.c14
-rw-r--r--src/window.h1
-rw-r--r--src/xdisp.c12
3 files changed, 13 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c
index 4d5c7e763ec..caf9df6c138 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 b6f88e8f55f..2400c422c15 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 8f7180381b4..9e5516602b4 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.