diff options
| author | Eli Zaretskii | 2023-02-17 09:40:32 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-02-17 09:40:32 +0200 |
| commit | b44a7ff85dc8074735c5a8baa1fdea9d47c35ffa (patch) | |
| tree | 73900aebcb7b702de00be124fd4585b87eff3945 | |
| parent | f1f571e72ae10285762d3a941e56f7c4048272af (diff) | |
| download | emacs-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.texi | 40 | ||||
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 11 |
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 |
| 1477 | If a frame has a non-@code{nil} title, it appears in the window | 1477 | If a frame has a non-@code{nil} title, that title appears in the window |
| 1478 | system's title bar at the top of the frame, and also in the mode line | 1478 | system's title bar at the top of the frame, and also in the mode line |
| 1479 | of windows in that frame if @code{mode-line-frame-identification} uses | 1479 | of 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 |
| 1481 | Emacs is not using a window system, and can only display one frame at | 1481 | Emacs is not using a window system, and can only display one frame at |
| 1482 | a time. @xref{Frame Titles}. | 1482 | a time. When Emacs is using a window system, this parameter, if |
| 1483 | non-@code{nil}, overrides the title determined by the @code{name} | ||
| 1484 | parameter 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 |
| 1486 | The name of the frame. The frame name serves as a default for the frame | 1490 | The name of the frame. If you don't specify a name via this |
| 1487 | title, if the @code{title} parameter is unspecified or @code{nil}. If | 1491 | parameter, Emacs sets the frame name automatically, as specified by |
| 1488 | you 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}). | 1493 | the frame's title that will appear on display when Emacs uses a window |
| 1494 | system (unless the @code{title} parameter overrides it). | ||
| 1490 | 1495 | ||
| 1491 | If you specify the frame name explicitly when you create the frame, the | 1496 | If you specify the frame name explicitly when you create the frame, the |
| 1492 | name is also used (instead of the name of the Emacs executable) when | 1497 | name 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 | |||
| 2630 | frame is redisplayed. | 2635 | frame is redisplayed. |
| 2631 | 2636 | ||
| 2632 | @defvar frame-title-format | 2637 | @defvar frame-title-format |
| 2633 | This variable specifies how to compute a name for a frame when you have | 2638 | This variable specifies how to compute a name for a frame when you |
| 2634 | not explicitly specified one. The variable's value is actually a mode | 2639 | have not explicitly specified one (via the frame's parameters; |
| 2640 | @pxref{Basic Parameters}). The variable's value is actually a mode | ||
| 2635 | line construct, just like @code{mode-line-format}, except that the | 2641 | line 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. |
| 2637 | Data}. | 2643 | @xref{Mode Line Data}. |
| 2638 | @end defvar | 2644 | @end defvar |
| 2639 | 2645 | ||
| 2640 | @defvar icon-title-format | 2646 | @defvar icon-title-format |
| 2641 | This variable specifies how to compute the name for an iconified frame, | 2647 | This variable specifies how to compute the name for an iconified frame |
| 2642 | when you have not explicitly specified the frame title. This title | 2648 | when you have not explicitly specified the frame's name via the |
| 2643 | appears in the icon itself. | 2649 | frame's parameters. The resulting title appears in the frame's icon |
| 2650 | itself. If the value is a string, is should be a mode line construct | ||
| 2651 | like that of @code{frame-title-format}. The value can also be | ||
| 2652 | @code{t}, which means to use @code{frame-title-format} instead; this | ||
| 2653 | avoids problems with some window managers and desktop environments, | ||
| 2654 | where a change in a frame's title (when a frame is iconified) is | ||
| 2655 | interpreted as a request to raise the frame and/or give it input | ||
| 2656 | focus. 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 |
| @@ -1202,6 +1202,13 @@ the most recently deleted frame. With a numerical prefix argument | |||
| 1202 | between 1 and 16, where 1 is the most recently deleted frame, undelete | 1202 | between 1 and 16, where 1 is the most recently deleted frame, undelete |
| 1203 | the corresponding deleted frame. | 1203 | the corresponding deleted frame. |
| 1204 | 1204 | ||
| 1205 | +++ | ||
| 1206 | *** The variable 'icon-title-format' can now have the value t. | ||
| 1207 | That value means to use 'frame-title-format' for iconified frames. | ||
| 1208 | This is useful with some window managers and desktop environments | ||
| 1209 | which treat changes in frame's title as requests to raise the frame | ||
| 1210 | and/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.) |
| 36611 | This variable has the same structure as `mode-line-format' (which see), | 36612 | If the value is a string, it should have the same structure |
| 36612 | and is used only on frames for which no explicit name has been set | 36613 | as `mode-line-format' (which see), and is used only on frames |
| 36613 | \(see `modify-frame-parameters'). */); | 36614 | for which no explicit name has been set \(see `modify-frame-parameters'). |
| 36615 | If the value is t, that means use `frame-title-format' for | ||
| 36616 | iconified 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 |