aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-02-04 03:00:25 +0000
committerRichard M. Stallman1996-02-04 03:00:25 +0000
commit943b580da367e7d1aca9360a2d5aae9e5592adb8 (patch)
treee04230a9fbc3da163c3310d3938d8a69ebe4da56 /src
parentda1c183cca56da10851bfbaca26ec38e941c2735 (diff)
downloademacs-943b580da367e7d1aca9360a2d5aae9e5592adb8.tar.gz
emacs-943b580da367e7d1aca9360a2d5aae9e5592adb8.zip
(x_frame_parms): Add "title" element.
(x_set_title): New function. (x_set_name): Let title prop override name prop for title use. (x_set_icon_name): Use title parm before name parm, if no icon_name.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c89
1 files changed, 82 insertions, 7 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 6b498c3b53f..83a3f2bebb4 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -670,6 +670,7 @@ void x_set_vertical_scroll_bars ();
670void x_set_visibility (); 670void x_set_visibility ();
671void x_set_menu_bar_lines (); 671void x_set_menu_bar_lines ();
672void x_set_scroll_bar_width (); 672void x_set_scroll_bar_width ();
673void x_set_title ();
673void x_set_unsplittable (); 674void x_set_unsplittable ();
674 675
675static struct x_frame_parm_table x_frame_parms[] = 676static struct x_frame_parm_table x_frame_parms[] =
@@ -690,6 +691,7 @@ static struct x_frame_parm_table x_frame_parms[] =
690 "mouse-color", x_set_mouse_color, 691 "mouse-color", x_set_mouse_color,
691 "name", x_explicitly_set_name, 692 "name", x_explicitly_set_name,
692 "scroll-bar-width", x_set_scroll_bar_width, 693 "scroll-bar-width", x_set_scroll_bar_width,
694 "title", x_set_title,
693 "unsplittable", x_set_unsplittable, 695 "unsplittable", x_set_unsplittable,
694 "vertical-scroll-bars", x_set_vertical_scroll_bars, 696 "vertical-scroll-bars", x_set_vertical_scroll_bars,
695 "visibility", x_set_visibility, 697 "visibility", x_set_visibility,
@@ -1382,7 +1384,7 @@ x_set_cursor_color (f, arg, oldval)
1382 } 1384 }
1383 } 1385 }
1384} 1386}
1385 1387
1386/* Set the border-color of frame F to value described by ARG. 1388/* Set the border-color of frame F to value described by ARG.
1387 ARG can be a string naming a color. 1389 ARG can be a string naming a color.
1388 The border-color is used for the border that is drawn by the X server. 1390 The border-color is used for the border that is drawn by the X server.
@@ -1461,7 +1463,7 @@ x_set_cursor_type (f, arg, oldval)
1461 often do people change cursor types? */ 1463 often do people change cursor types? */
1462 update_mode_lines++; 1464 update_mode_lines++;
1463} 1465}
1464 1466
1465void 1467void
1466x_set_icon_type (f, arg, oldval) 1468x_set_icon_type (f, arg, oldval)
1467 struct frame *f; 1469 struct frame *f;
@@ -1538,6 +1540,8 @@ x_set_icon_name (f, arg, oldval)
1538 result = x_text_icon (f, 1540 result = x_text_icon (f,
1539 (char *) XSTRING ((!NILP (f->icon_name) 1541 (char *) XSTRING ((!NILP (f->icon_name)
1540 ? f->icon_name 1542 ? f->icon_name
1543 : !NILP (f->title)
1544 ? f->title
1541 : f->name))->data); 1545 : f->name))->data);
1542 1546
1543 if (result) 1547 if (result)
@@ -1549,7 +1553,7 @@ x_set_icon_name (f, arg, oldval)
1549 XFlush (FRAME_X_DISPLAY (f)); 1553 XFlush (FRAME_X_DISPLAY (f));
1550 UNBLOCK_INPUT; 1554 UNBLOCK_INPUT;
1551} 1555}
1552 1556
1553extern Lisp_Object x_new_font (); 1557extern Lisp_Object x_new_font ();
1554 1558
1555void 1559void
@@ -1638,7 +1642,7 @@ x_set_visibility (f, value, oldval)
1638 else 1642 else
1639 Fmake_frame_visible (frame); 1643 Fmake_frame_visible (frame);
1640} 1644}
1641 1645
1642static void 1646static void
1643x_set_menu_bar_lines_1 (window, n) 1647x_set_menu_bar_lines_1 (window, n)
1644 Lisp_Object window; 1648 Lisp_Object window;
@@ -1703,7 +1707,7 @@ x_set_menu_bar_lines (f, value, oldval)
1703 x_set_menu_bar_lines_1 (f->root_window, nlines - olines); 1707 x_set_menu_bar_lines_1 (f->root_window, nlines - olines);
1704#endif /* not USE_X_TOOLKIT */ 1708#endif /* not USE_X_TOOLKIT */
1705} 1709}
1706 1710
1707/* Change the name of frame F to NAME. If NAME is nil, set F's name to 1711/* Change the name of frame F to NAME. If NAME is nil, set F's name to
1708 x_id_name. 1712 x_id_name.
1709 1713
@@ -1752,6 +1756,13 @@ x_set_name (f, name, explicit)
1752 if (! NILP (Fstring_equal (name, f->name))) 1756 if (! NILP (Fstring_equal (name, f->name)))
1753 return; 1757 return;
1754 1758
1759 f->name = name;
1760
1761 /* For setting the frame title, the title parameter should override
1762 the name parameter. */
1763 if (! NILP (f->title))
1764 name = f->title;
1765
1755 if (FRAME_X_WINDOW (f)) 1766 if (FRAME_X_WINDOW (f))
1756 { 1767 {
1757 BLOCK_INPUT; 1768 BLOCK_INPUT;
@@ -1789,8 +1800,6 @@ x_set_name (f, name, explicit)
1789#endif /* not HAVE_X11R4 */ 1800#endif /* not HAVE_X11R4 */
1790 UNBLOCK_INPUT; 1801 UNBLOCK_INPUT;
1791 } 1802 }
1792
1793 f->name = name;
1794} 1803}
1795 1804
1796/* This function should be called when the user's lisp code has 1805/* This function should be called when the user's lisp code has
@@ -1814,7 +1823,73 @@ x_implicitly_set_name (f, arg, oldval)
1814{ 1823{
1815 x_set_name (f, arg, 0); 1824 x_set_name (f, arg, 0);
1816} 1825}
1826
1827/* Change the title of frame F to NAME.
1828 If NAME is nil, use the frame name as the title.
1829
1830 If EXPLICIT is non-zero, that indicates that lisp code is setting the
1831 name; if NAME is a string, set F's name to NAME and set
1832 F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
1833
1834 If EXPLICIT is zero, that indicates that Emacs redisplay code is
1835 suggesting a new name, which lisp code should override; if
1836 F->explicit_name is set, ignore the new name; otherwise, set it. */
1837
1838void
1839x_set_title (f, name)
1840 struct frame *f;
1841 Lisp_Object name;
1842{
1843 /* Don't change the title if it's already NAME. */
1844 if (EQ (name, f->title))
1845 return;
1846
1847 update_mode_lines = 1;
1848
1849 f->title = name;
1850
1851 if (NILP (name))
1852 name = f->name;
1853
1854 if (FRAME_X_WINDOW (f))
1855 {
1856 BLOCK_INPUT;
1857#ifdef HAVE_X11R4
1858 {
1859 XTextProperty text, icon;
1860 Lisp_Object icon_name;
1817 1861
1862 text.value = XSTRING (name)->data;
1863 text.encoding = XA_STRING;
1864 text.format = 8;
1865 text.nitems = XSTRING (name)->size;
1866
1867 icon_name = (!NILP (f->icon_name) ? f->icon_name : name);
1868
1869 icon.value = XSTRING (icon_name)->data;
1870 icon.encoding = XA_STRING;
1871 icon.format = 8;
1872 icon.nitems = XSTRING (icon_name)->size;
1873#ifdef USE_X_TOOLKIT
1874 XSetWMName (FRAME_X_DISPLAY (f),
1875 XtWindow (f->output_data.x->widget), &text);
1876 XSetWMIconName (FRAME_X_DISPLAY (f), XtWindow (f->output_data.x->widget),
1877 &icon);
1878#else /* not USE_X_TOOLKIT */
1879 XSetWMName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &text);
1880 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon);
1881#endif /* not USE_X_TOOLKIT */
1882 }
1883#else /* not HAVE_X11R4 */
1884 XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1885 XSTRING (name)->data);
1886 XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
1887 XSTRING (name)->data);
1888#endif /* not HAVE_X11R4 */
1889 UNBLOCK_INPUT;
1890 }
1891}
1892
1818void 1893void
1819x_set_autoraise (f, arg, oldval) 1894x_set_autoraise (f, arg, oldval)
1820 struct frame *f; 1895 struct frame *f;