aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2023-02-17 09:40:32 +0200
committerEli Zaretskii2023-02-17 09:40:32 +0200
commitb44a7ff85dc8074735c5a8baa1fdea9d47c35ffa (patch)
tree73900aebcb7b702de00be124fd4585b87eff3945
parentf1f571e72ae10285762d3a941e56f7c4048272af (diff)
downloademacs-b44a7ff85dc8074735c5a8baa1fdea9d47c35ffa.tar.gz
emacs-b44a7ff85dc8074735c5a8baa1fdea9d47c35ffa.zip
Allow 'icon-title-format' to have the value t
* src/xdisp.c (gui_consider_frame_title, syms_of_xdisp): If the value of 'icon-title-format' is t, use 'frame-title-format' instead. (Bug#61496) * etc/NEWS: * doc/lispref/frames.texi (Frame Titles): Document the new handling of the value t. (Basic Parameters): Fix the documentation of the 'title' and 'name' frame parameters.
-rw-r--r--doc/lispref/frames.texi40
-rw-r--r--etc/NEWS7
-rw-r--r--src/xdisp.c11
3 files changed, 41 insertions, 17 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 68f31e500bb..638b759ff13 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1474,19 +1474,24 @@ in this frame. Its value is @code{color}, @code{grayscale} or
1474 1474
1475@vindex title@r{, a frame parameter} 1475@vindex title@r{, a frame parameter}
1476@item title 1476@item title
1477If a frame has a non-@code{nil} title, it appears in the window 1477If a frame has a non-@code{nil} title, that title appears in the window
1478system's title bar at the top of the frame, and also in the mode line 1478system's title bar at the top of the frame, and also in the mode line
1479of windows in that frame if @code{mode-line-frame-identification} uses 1479of windows in that frame if @code{mode-line-frame-identification} uses
1480@samp{%F} (@pxref{%-Constructs}). This is normally the case when 1480@samp{%F} (@pxref{%-Constructs}). This is normally the case when
1481Emacs is not using a window system, and can only display one frame at 1481Emacs is not using a window system, and can only display one frame at
1482a time. @xref{Frame Titles}. 1482a time. When Emacs is using a window system, this parameter, if
1483non-@code{nil}, overrides the title determined by the @code{name}
1484parameter and the implicit title calculated according to
1485@code{frame-title-format}. It also overrides the title determined by
1486@code{icon-title-format} for iconified frames. @xref{Frame Titles}.
1483 1487
1484@vindex name@r{, a frame parameter} 1488@vindex name@r{, a frame parameter}
1485@item name 1489@item name
1486The name of the frame. The frame name serves as a default for the frame 1490The name of the frame. If you don't specify a name via this
1487title, if the @code{title} parameter is unspecified or @code{nil}. If 1491parameter, Emacs sets the frame name automatically, as specified by
1488you don't specify a name, Emacs sets the frame name automatically 1492@code{frame-title-format} and @code{icon-title-format}, and that is
1489(@pxref{Frame Titles}). 1493the frame's title that will appear on display when Emacs uses a window
1494system (unless the @code{title} parameter overrides it).
1490 1495
1491If you specify the frame name explicitly when you create the frame, the 1496If you specify the frame name explicitly when you create the frame, the
1492name is also used (instead of the name of the Emacs executable) when 1497name is also used (instead of the name of the Emacs executable) when
@@ -2630,17 +2635,26 @@ frame name automatically based on a template stored in the variable
2630frame is redisplayed. 2635frame is redisplayed.
2631 2636
2632@defvar frame-title-format 2637@defvar frame-title-format
2633This variable specifies how to compute a name for a frame when you have 2638This variable specifies how to compute a name for a frame when you
2634not explicitly specified one. The variable's value is actually a mode 2639have not explicitly specified one (via the frame's parameters;
2640@pxref{Basic Parameters}). The variable's value is actually a mode
2635line construct, just like @code{mode-line-format}, except that the 2641line construct, just like @code{mode-line-format}, except that the
2636@samp{%c}, @samp{%C}, and @samp{%l} constructs are ignored. @xref{Mode Line 2642@samp{%c}, @samp{%C}, and @samp{%l} constructs are ignored.
2637Data}. 2643@xref{Mode Line Data}.
2638@end defvar 2644@end defvar
2639 2645
2640@defvar icon-title-format 2646@defvar icon-title-format
2641This variable specifies how to compute the name for an iconified frame, 2647This variable specifies how to compute the name for an iconified frame
2642when you have not explicitly specified the frame title. This title 2648when you have not explicitly specified the frame's name via the
2643appears in the icon itself. 2649frame's parameters. The resulting title appears in the frame's icon
2650itself. If the value is a string, is should be a mode line construct
2651like that of @code{frame-title-format}. The value can also be
2652@code{t}, which means to use @code{frame-title-format} instead; this
2653avoids problems with some window managers and desktop environments,
2654where a change in a frame's title (when a frame is iconified) is
2655interpreted as a request to raise the frame and/or give it input
2656focus. The default is a string identical to the default value of
2657@code{frame-title-format}.
2644@end defvar 2658@end defvar
2645 2659
2646@defvar multiple-frames 2660@defvar multiple-frames
diff --git a/etc/NEWS b/etc/NEWS
index 35063678f58..133c07e56df 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1202,6 +1202,13 @@ the most recently deleted frame. With a numerical prefix argument
1202between 1 and 16, where 1 is the most recently deleted frame, undelete 1202between 1 and 16, where 1 is the most recently deleted frame, undelete
1203the corresponding deleted frame. 1203the corresponding deleted frame.
1204 1204
1205+++
1206*** The variable 'icon-title-format' can now have the value t.
1207That value means to use 'frame-title-format' for iconified frames.
1208This is useful with some window managers and desktop environments
1209which treat changes in frame's title as requests to raise the frame
1210and/or give it input focus.
1211
1205** Tab Bars and Tab Lines 1212** Tab Bars and Tab Lines
1206 1213
1207--- 1214---
diff --git a/src/xdisp.c b/src/xdisp.c
index 5c5ecaa2bcb..1f630de7586 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13424,7 +13424,8 @@ gui_consider_frame_title (Lisp_Object frame)
13424 13424
13425 Fselect_window (f->selected_window, Qt); 13425 Fselect_window (f->selected_window, Qt);
13426 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->contents)); 13426 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->contents));
13427 fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; 13427 fmt = (FRAME_ICONIFIED_P (f) && !EQ (Vicon_title_format, Qt)
13428 ? Vicon_title_format : Vframe_title_format);
13428 13429
13429 mode_line_target = MODE_LINE_TITLE; 13430 mode_line_target = MODE_LINE_TITLE;
13430 title_start = MODE_LINE_NOPROP_LEN (0); 13431 title_start = MODE_LINE_NOPROP_LEN (0);
@@ -36608,9 +36609,11 @@ which no explicit name has been set (see `modify-frame-parameters'). */);
36608 DEFVAR_LISP ("icon-title-format", Vicon_title_format, 36609 DEFVAR_LISP ("icon-title-format", Vicon_title_format,
36609 doc: /* Template for displaying the title bar of an iconified frame. 36610 doc: /* Template for displaying the title bar of an iconified frame.
36610\(Assuming the window manager supports this feature.) 36611\(Assuming the window manager supports this feature.)
36611This variable has the same structure as `mode-line-format' (which see), 36612If the value is a string, it should have the same structure
36612and is used only on frames for which no explicit name has been set 36613as `mode-line-format' (which see), and is used only on frames
36613\(see `modify-frame-parameters'). */); 36614for which no explicit name has been set \(see `modify-frame-parameters').
36615If the value is t, that means use `frame-title-format' for
36616iconified frames. */);
36614 /* Do not nest calls to pure_list. This works around a bug in 36617 /* Do not nest calls to pure_list. This works around a bug in
36615 Oracle Developer Studio 12.6. */ 36618 Oracle Developer Studio 12.6. */
36616 Lisp_Object icon_title_name_format 36619 Lisp_Object icon_title_name_format