diff options
| author | Richard M. Stallman | 1994-04-10 06:04:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-10 06:04:33 +0000 |
| commit | 8fc2766b6434feb36832e5f150a288c00d3d19bb (patch) | |
| tree | a415ddc791e824e78cf0fafcde5ff4b65ce97748 /src | |
| parent | 6ae9a3f2f257e36cf91cf76b8b621059de42e607 (diff) | |
| download | emacs-8fc2766b6434feb36832e5f150a288c00d3d19bb.tar.gz emacs-8fc2766b6434feb36832e5f150a288c00d3d19bb.zip | |
(x_figure_window_size): Don't call x_calc_absolute_position.
(x_window): Separate into two alternative definitions.
Call x_calc_absolute_position here.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 87 |
1 files changed, 67 insertions, 20 deletions
diff --git a/src/xfns.c b/src/xfns.c index aa824444dca..2b3be77fb57 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1555,7 +1555,9 @@ Returns an alist of the form ((top . TOP), (left . LEFT) ... ).") | |||
| 1555 | 1555 | ||
| 1556 | #ifdef HAVE_X11 | 1556 | #ifdef HAVE_X11 |
| 1557 | /* Calculate the desired size and position of this window, | 1557 | /* Calculate the desired size and position of this window, |
| 1558 | or set rubber-band prompting if none. */ | 1558 | and return the attributes saying which aspects were specified. |
| 1559 | |||
| 1560 | This function does not make the coordinates positive. */ | ||
| 1559 | 1561 | ||
| 1560 | #define DEFAULT_ROWS 40 | 1562 | #define DEFAULT_ROWS 40 |
| 1561 | #define DEFAULT_COLS 80 | 1563 | #define DEFAULT_COLS 80 |
| @@ -1608,7 +1610,10 @@ x_figure_window_size (f, parms) | |||
| 1608 | CHECK_NUMBER (tem1, 0); | 1610 | CHECK_NUMBER (tem1, 0); |
| 1609 | f->display.x->top_pos = XINT (tem0); | 1611 | f->display.x->top_pos = XINT (tem0); |
| 1610 | f->display.x->left_pos = XINT (tem1); | 1612 | f->display.x->left_pos = XINT (tem1); |
| 1611 | x_calc_absolute_position (f); | 1613 | if (f->display.x->top_pos < 0) |
| 1614 | window_prompting |= YNegative; | ||
| 1615 | if (f->display.x->left_pos < 0) | ||
| 1616 | window_prompting |= YNegative; | ||
| 1612 | window_prompting |= USPosition; | 1617 | window_prompting |= USPosition; |
| 1613 | } | 1618 | } |
| 1614 | else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) | 1619 | else if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound)) |
| @@ -1713,24 +1718,20 @@ hack_wm_protocols (widget) | |||
| 1713 | } | 1718 | } |
| 1714 | #endif | 1719 | #endif |
| 1715 | 1720 | ||
| 1716 | /* Create and set up the X window or widget for frame F. */ | 1721 | #ifdef USE_X_TOOLKIT |
| 1722 | |||
| 1723 | /* Create and set up the X widget for frame F. */ | ||
| 1717 | 1724 | ||
| 1718 | static void | 1725 | static void |
| 1719 | #ifdef USE_X_TOOLKIT | ||
| 1720 | x_window (f, window_prompting, minibuffer_only) | 1726 | x_window (f, window_prompting, minibuffer_only) |
| 1721 | struct frame *f; | 1727 | struct frame *f; |
| 1722 | long window_prompting; | 1728 | long window_prompting; |
| 1723 | int minibuffer_only; | 1729 | int minibuffer_only; |
| 1724 | #else /* not USE_X_TOOLKIT */ | ||
| 1725 | x_window (f) | ||
| 1726 | struct frame *f; | ||
| 1727 | #endif /* not USE_X_TOOLKIT */ | ||
| 1728 | { | 1730 | { |
| 1729 | XClassHint class_hints; | 1731 | XClassHint class_hints; |
| 1730 | XSetWindowAttributes attributes; | 1732 | XSetWindowAttributes attributes; |
| 1731 | unsigned long attribute_mask; | 1733 | unsigned long attribute_mask; |
| 1732 | 1734 | ||
| 1733 | #ifdef USE_X_TOOLKIT | ||
| 1734 | Widget shell_widget; | 1735 | Widget shell_widget; |
| 1735 | Widget pane_widget; | 1736 | Widget pane_widget; |
| 1736 | Widget screen_widget; | 1737 | Widget screen_widget; |
| @@ -1793,17 +1794,27 @@ x_window (f) | |||
| 1793 | char *tem, shell_position[32]; | 1794 | char *tem, shell_position[32]; |
| 1794 | Arg al[2]; | 1795 | Arg al[2]; |
| 1795 | int ac = 0; | 1796 | int ac = 0; |
| 1796 | int menubar_size = | 1797 | int menubar_size |
| 1797 | (f->display.x->menubar_widget | 1798 | = (f->display.x->menubar_widget |
| 1798 | ? (f->display.x->menubar_widget->core.height | 1799 | ? (f->display.x->menubar_widget->core.height |
| 1799 | + f->display.x->menubar_widget->core.border_width) | 1800 | + f->display.x->menubar_widget->core.border_width) |
| 1800 | : 0); | 1801 | : 0); |
| 1801 | 1802 | ||
| 1802 | if (window_prompting & USPosition) | 1803 | if (window_prompting & USPosition) |
| 1803 | sprintf (shell_position, "=%dx%d%c%d%c%d", PIXEL_WIDTH (f), | 1804 | { |
| 1804 | PIXEL_HEIGHT (f) + menubar_size, | 1805 | int left = f->display.x->left_pos; |
| 1805 | '+', f->display.x->left_pos, | 1806 | int xneg = left < 0; |
| 1806 | '+', f->display.x->top_pos); | 1807 | int top = f->display.x->top_pos; |
| 1808 | int yneg = top < 0; | ||
| 1809 | if (left < 0) | ||
| 1810 | left = -left; | ||
| 1811 | if (top < 0) | ||
| 1812 | top = -top; | ||
| 1813 | sprintf (shell_position, "=%dx%d%c%d%c%d", PIXEL_WIDTH (f), | ||
| 1814 | PIXEL_HEIGHT (f) + menubar_size, | ||
| 1815 | (xneg ? '-' : '+'), left, | ||
| 1816 | (yneg ? '-' : '+'), top); | ||
| 1817 | } | ||
| 1807 | else | 1818 | else |
| 1808 | sprintf (shell_position, "=%dx%d", PIXEL_WIDTH (f), | 1819 | sprintf (shell_position, "=%dx%d", PIXEL_WIDTH (f), |
| 1809 | PIXEL_HEIGHT (f) + menubar_size); | 1820 | PIXEL_HEIGHT (f) + menubar_size); |
| @@ -1814,7 +1825,8 @@ x_window (f) | |||
| 1814 | XtSetValues (shell_widget, al, ac); | 1825 | XtSetValues (shell_widget, al, ac); |
| 1815 | } | 1826 | } |
| 1816 | 1827 | ||
| 1817 | 1828 | x_calc_absolute_position (f); | |
| 1829 | |||
| 1818 | XtManageChild (pane_widget); | 1830 | XtManageChild (pane_widget); |
| 1819 | XtRealizeWidget (shell_widget); | 1831 | XtRealizeWidget (shell_widget); |
| 1820 | 1832 | ||
| @@ -1843,8 +1855,42 @@ x_window (f) | |||
| 1843 | 1855 | ||
| 1844 | XtMapWidget (screen_widget); | 1856 | XtMapWidget (screen_widget); |
| 1845 | 1857 | ||
| 1858 | /* x_set_name normally ignores requests to set the name if the | ||
| 1859 | requested name is the same as the current name. This is the one | ||
| 1860 | place where that assumption isn't correct; f->name is set, but | ||
| 1861 | the X server hasn't been told. */ | ||
| 1862 | { | ||
| 1863 | Lisp_Object name; | ||
| 1864 | int explicit = f->explicit_name; | ||
| 1865 | |||
| 1866 | f->explicit_name = 0; | ||
| 1867 | name = f->name; | ||
| 1868 | f->name = Qnil; | ||
| 1869 | x_set_name (f, name, explicit); | ||
| 1870 | } | ||
| 1871 | |||
| 1872 | XDefineCursor (XDISPLAY FRAME_X_WINDOW (f), | ||
| 1873 | f->display.x->text_cursor); | ||
| 1874 | |||
| 1875 | UNBLOCK_INPUT; | ||
| 1876 | |||
| 1877 | if (FRAME_X_WINDOW (f) == 0) | ||
| 1878 | error ("Unable to create window"); | ||
| 1879 | } | ||
| 1880 | |||
| 1846 | #else /* not USE_X_TOOLKIT */ | 1881 | #else /* not USE_X_TOOLKIT */ |
| 1847 | 1882 | ||
| 1883 | /* Create and set up the X window for frame F. */ | ||
| 1884 | |||
| 1885 | x_window (f) | ||
| 1886 | struct frame *f; | ||
| 1887 | |||
| 1888 | { | ||
| 1889 | XClassHint class_hints; | ||
| 1890 | XSetWindowAttributes attributes; | ||
| 1891 | unsigned long attribute_mask; | ||
| 1892 | |||
| 1893 | x_calc_absolute_position (f); | ||
| 1848 | 1894 | ||
| 1849 | attributes.background_pixel = f->display.x->background_pixel; | 1895 | attributes.background_pixel = f->display.x->background_pixel; |
| 1850 | attributes.border_pixel = f->display.x->border_pixel; | 1896 | attributes.border_pixel = f->display.x->border_pixel; |
| @@ -1886,7 +1932,6 @@ x_window (f) | |||
| 1886 | XSetWMProtocols (x_current_display, FRAME_X_WINDOW (f), | 1932 | XSetWMProtocols (x_current_display, FRAME_X_WINDOW (f), |
| 1887 | &Xatom_wm_delete_window, 1); | 1933 | &Xatom_wm_delete_window, 1); |
| 1888 | 1934 | ||
| 1889 | #endif /* not USE_X_TOOLKIT */ | ||
| 1890 | 1935 | ||
| 1891 | /* x_set_name normally ignores requests to set the name if the | 1936 | /* x_set_name normally ignores requests to set the name if the |
| 1892 | requested name is the same as the current name. This is the one | 1937 | requested name is the same as the current name. This is the one |
| @@ -1911,6 +1956,8 @@ x_window (f) | |||
| 1911 | error ("Unable to create window"); | 1956 | error ("Unable to create window"); |
| 1912 | } | 1957 | } |
| 1913 | 1958 | ||
| 1959 | #endif /* not USE_X_TOOLKIT */ | ||
| 1960 | |||
| 1914 | /* Handle the icon stuff for this window. Perhaps later we might | 1961 | /* Handle the icon stuff for this window. Perhaps later we might |
| 1915 | want an x_set_icon_position which can be called interactively as | 1962 | want an x_set_icon_position which can be called interactively as |
| 1916 | well. */ | 1963 | well. */ |