aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2022-06-09 21:48:19 +0800
committerPo Lu2022-06-09 21:50:37 +0800
commite99f41f03a97641ee05ba4a27f8b91c190f55df1 (patch)
treeb8bb2ab447143124982557c01875c327e85f47dc
parent39d2efbfae1dc081258a764f3c47f5f492f38fec (diff)
downloademacs-e99f41f03a97641ee05ba4a27f8b91c190f55df1.tar.gz
emacs-e99f41f03a97641ee05ba4a27f8b91c190f55df1.zip
Fix recalculation of `icon-title-format' after a frame is iconified
Previously it would only happen upon the next mode line redisplay, meaning that just pressing C-z would not update the implicit title, since C-z doesn't cause a redisplay. * src/dispextern.h: Update prototypes. * src/frame.h (SET_FRAME_ICONIFIED): De-slugify. Call `gui_consider_frame_title', since `icon-title-format' might be different from the current frame title. * src/xdisp.c (gui_consider_frame_title): Export (also in dispextern.h). (bug#55850)
-rw-r--r--src/dispextern.h1
-rw-r--r--src/frame.h24
-rw-r--r--src/xdisp.c2
3 files changed, 24 insertions, 3 deletions
diff --git a/src/dispextern.h b/src/dispextern.h
index 910f630a50c..c7399ca2998 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3470,6 +3470,7 @@ extern void expose_frame (struct frame *, int, int, int, int);
3470extern bool gui_intersect_rectangles (const Emacs_Rectangle *, 3470extern bool gui_intersect_rectangles (const Emacs_Rectangle *,
3471 const Emacs_Rectangle *, 3471 const Emacs_Rectangle *,
3472 Emacs_Rectangle *); 3472 Emacs_Rectangle *);
3473extern void gui_consider_frame_title (Lisp_Object);
3473#endif /* HAVE_WINDOW_SYSTEM */ 3474#endif /* HAVE_WINDOW_SYSTEM */
3474 3475
3475extern void note_mouse_highlight (struct frame *, int, int); 3476extern void note_mouse_highlight (struct frame *, int, int);
diff --git a/src/frame.h b/src/frame.h
index a164853e09d..458b6257e49 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1293,8 +1293,28 @@ SET_FRAME_VISIBLE (struct frame *f, int v)
1293} 1293}
1294 1294
1295/* Set iconified status of frame F. */ 1295/* Set iconified status of frame F. */
1296#define SET_FRAME_ICONIFIED(f, i) \ 1296INLINE void
1297 (f)->iconified = (eassert (0 <= (i) && (i) <= 1), (i)) 1297SET_FRAME_ICONIFIED (struct frame *f, int i)
1298{
1299#ifdef HAVE_WINDOW_SYSTEM
1300 Lisp_Object frame;
1301#endif
1302
1303 eassert (0 <= (i) && (i) <= 1);
1304
1305 f->iconified = i;
1306
1307#ifdef HAVE_WINDOW_SYSTEM
1308 /* Iconifying a frame might cause the frame title to change if no
1309 title was explicitly specified. Force the frame title to be
1310 recomputed. */
1311
1312 XSETFRAME (frame, f);
1313
1314 if (FRAME_WINDOW_P (f))
1315 gui_consider_frame_title (frame);
1316#endif
1317}
1298 1318
1299extern Lisp_Object selected_frame; 1319extern Lisp_Object selected_frame;
1300extern Lisp_Object old_selected_frame; 1320extern Lisp_Object old_selected_frame;
diff --git a/src/xdisp.c b/src/xdisp.c
index 07324815d90..2245326b0d8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13148,7 +13148,7 @@ store_mode_line_noprop (const char *string, int field_width, int precision)
13148 Vicon_title_format if FRAME is iconified, otherwise it is 13148 Vicon_title_format if FRAME is iconified, otherwise it is
13149 frame_title_format. */ 13149 frame_title_format. */
13150 13150
13151static void 13151void
13152gui_consider_frame_title (Lisp_Object frame) 13152gui_consider_frame_title (Lisp_Object frame)
13153{ 13153{
13154 struct frame *f = XFRAME (frame); 13154 struct frame *f = XFRAME (frame);