diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 57 |
1 files changed, 48 insertions, 9 deletions
diff --git a/src/xfns.c b/src/xfns.c index ca04c69176d..5eaf11447cc 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1699,8 +1699,15 @@ hack_wm_protocols (widget) | |||
| 1699 | /* Create and set up the X window or widget for frame F. */ | 1699 | /* Create and set up the X window or widget for frame F. */ |
| 1700 | 1700 | ||
| 1701 | static void | 1701 | static void |
| 1702 | #ifdef USE_X_TOOLKIT | ||
| 1703 | x_window (f, window_prompting, minibuffer_only) | ||
| 1704 | struct frame *f; | ||
| 1705 | long window_prompting; | ||
| 1706 | int minibuffer_only; | ||
| 1707 | #else /* not USE_X_TOOLKIT */ | ||
| 1702 | x_window (f) | 1708 | x_window (f) |
| 1703 | struct frame *f; | 1709 | struct frame *f; |
| 1710 | #endif /* not USE_X_TOOLKIT */ | ||
| 1704 | { | 1711 | { |
| 1705 | XClassHint class_hints; | 1712 | XClassHint class_hints; |
| 1706 | XSetWindowAttributes attributes; | 1713 | XSetWindowAttributes attributes; |
| @@ -1724,12 +1731,11 @@ x_window (f) | |||
| 1724 | ac = 0; | 1731 | ac = 0; |
| 1725 | XtSetArg (al[ac], XtNallowShellResize, 1); ac++; | 1732 | XtSetArg (al[ac], XtNallowShellResize, 1); ac++; |
| 1726 | XtSetArg (al[ac], XtNinput, 1); ac++; | 1733 | XtSetArg (al[ac], XtNinput, 1); ac++; |
| 1727 | XtSetArg (al[ac], XtNx, f->display.x->left_pos); ac++; | ||
| 1728 | XtSetArg (al[ac], XtNy, f->display.x->top_pos); ac++; | ||
| 1729 | shell_widget = XtCreatePopupShell ("shell", | 1734 | shell_widget = XtCreatePopupShell ("shell", |
| 1730 | topLevelShellWidgetClass, | 1735 | topLevelShellWidgetClass, |
| 1731 | Xt_app_shell, al, ac); | 1736 | Xt_app_shell, al, ac); |
| 1732 | 1737 | ||
| 1738 | f->display.x->widget = shell_widget; | ||
| 1733 | /* maybe_set_screen_title_format (shell_widget); */ | 1739 | /* maybe_set_screen_title_format (shell_widget); */ |
| 1734 | 1740 | ||
| 1735 | 1741 | ||
| @@ -1739,6 +1745,11 @@ x_window (f) | |||
| 1739 | panedWidgetClass, | 1745 | panedWidgetClass, |
| 1740 | shell_widget, al, ac); | 1746 | shell_widget, al, ac); |
| 1741 | 1747 | ||
| 1748 | f->display.x->column_widget = pane_widget; | ||
| 1749 | |||
| 1750 | if (!minibuffer_only) | ||
| 1751 | initialize_frame_menubar (f); | ||
| 1752 | |||
| 1742 | /* mappedWhenManaged to false tells to the paned window to not map/unmap | 1753 | /* mappedWhenManaged to false tells to the paned window to not map/unmap |
| 1743 | * the emacs screen when changing menubar. This reduces flickering a lot. | 1754 | * the emacs screen when changing menubar. This reduces flickering a lot. |
| 1744 | */ | 1755 | */ |
| @@ -1754,10 +1765,36 @@ x_window (f) | |||
| 1754 | pane_widget, al, ac); | 1765 | pane_widget, al, ac); |
| 1755 | 1766 | ||
| 1756 | f->display.x->edit_widget = screen_widget; | 1767 | f->display.x->edit_widget = screen_widget; |
| 1757 | f->display.x->widget = shell_widget; | ||
| 1758 | f->display.x->column_widget = pane_widget; | ||
| 1759 | 1768 | ||
| 1769 | if (f->display.x->menubar_widget) | ||
| 1770 | XtManageChild (f->display.x->menubar_widget); | ||
| 1760 | XtManageChild (screen_widget); | 1771 | XtManageChild (screen_widget); |
| 1772 | |||
| 1773 | /* Do some needed geometry management. */ | ||
| 1774 | { | ||
| 1775 | int len; | ||
| 1776 | char *tem, shell_position[32]; | ||
| 1777 | Arg al[2]; | ||
| 1778 | int ac = 0; | ||
| 1779 | |||
| 1780 | if (window_prompting & USPosition) | ||
| 1781 | sprintf (shell_position, "=%dx%d%c%d%c%d", PIXEL_WIDTH (f), | ||
| 1782 | PIXEL_HEIGHT (f) + f->display.x->menubar_widget->core.height | ||
| 1783 | + f->display.x->menubar_widget->core.border_width, | ||
| 1784 | '+', f->display.x->left_pos, | ||
| 1785 | '+', f->display.x->top_pos); | ||
| 1786 | else | ||
| 1787 | sprintf (shell_position, "=%dx%d", PIXEL_WIDTH (f), | ||
| 1788 | PIXEL_HEIGHT (f) + f->display.x->menubar_widget->core.height | ||
| 1789 | + f->display.x->menubar_widget->core.border_width); | ||
| 1790 | len = strlen (shell_position) + 1; | ||
| 1791 | tem = (char *) xmalloc (len); | ||
| 1792 | strncpy (tem, shell_position, len); | ||
| 1793 | XtSetArg (al[ac], XtNgeometry, tem); ac++; | ||
| 1794 | XtSetValues (shell_widget, al, ac); | ||
| 1795 | } | ||
| 1796 | |||
| 1797 | |||
| 1761 | XtManageChild (pane_widget); | 1798 | XtManageChild (pane_widget); |
| 1762 | XtRealizeWidget (shell_widget); | 1799 | XtRealizeWidget (shell_widget); |
| 1763 | 1800 | ||
| @@ -2097,7 +2134,11 @@ be shared by the new frame.") | |||
| 2097 | f->display.x->parent_desc = ROOT_WINDOW; | 2134 | f->display.x->parent_desc = ROOT_WINDOW; |
| 2098 | window_prompting = x_figure_window_size (f, parms); | 2135 | window_prompting = x_figure_window_size (f, parms); |
| 2099 | 2136 | ||
| 2137 | #ifdef USE_X_TOOLKIT | ||
| 2138 | x_window (f, window_prompting, minibuffer_only); | ||
| 2139 | #else | ||
| 2100 | x_window (f); | 2140 | x_window (f); |
| 2141 | #endif | ||
| 2101 | x_icon (f, parms); | 2142 | x_icon (f, parms); |
| 2102 | x_make_gc (f); | 2143 | x_make_gc (f); |
| 2103 | init_frame_faces (f); | 2144 | init_frame_faces (f); |
| @@ -2125,11 +2166,14 @@ be shared by the new frame.") | |||
| 2125 | x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), | 2166 | x_default_parameter (f, parms, Qmenu_bar_lines, make_number (0), |
| 2126 | "menuBarLines", "MenuBarLines", number); | 2167 | "menuBarLines", "MenuBarLines", number); |
| 2127 | 2168 | ||
| 2169 | /* With the toolkit, the geometry management is done in x_window. */ | ||
| 2170 | #ifndef USE_X_TOOLKIT | ||
| 2128 | tem0 = x_get_arg (parms, Qleft, 0, 0, number); | 2171 | tem0 = x_get_arg (parms, Qleft, 0, 0, number); |
| 2129 | tem1 = x_get_arg (parms, Qtop, 0, 0, number); | 2172 | tem1 = x_get_arg (parms, Qtop, 0, 0, number); |
| 2130 | BLOCK_INPUT; | 2173 | BLOCK_INPUT; |
| 2131 | x_wm_set_size_hint (f, window_prompting, 1, XINT (tem0), XINT (tem1)); | 2174 | x_wm_set_size_hint (f, window_prompting, 1, XINT (tem0), XINT (tem1)); |
| 2132 | UNBLOCK_INPUT; | 2175 | UNBLOCK_INPUT; |
| 2176 | #endif /* USE_X_TOOLKIT */ | ||
| 2133 | 2177 | ||
| 2134 | tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); | 2178 | tem = x_get_arg (parms, Qunsplittable, 0, 0, boolean); |
| 2135 | f->no_split = minibuffer_only || EQ (tem, Qt); | 2179 | f->no_split = minibuffer_only || EQ (tem, Qt); |
| @@ -2140,11 +2184,6 @@ be shared by the new frame.") | |||
| 2140 | or making it visible won't work. */ | 2184 | or making it visible won't work. */ |
| 2141 | Vframe_list = Fcons (frame, Vframe_list); | 2185 | Vframe_list = Fcons (frame, Vframe_list); |
| 2142 | 2186 | ||
| 2143 | #ifdef USE_X_TOOLKIT | ||
| 2144 | /* Compute the size of the menubar and display it. */ | ||
| 2145 | initialize_frame_menubar (f); | ||
| 2146 | #endif /* USE_X_TOOLKIT */ | ||
| 2147 | |||
| 2148 | /* Make the window appear on the frame and enable display, | 2187 | /* Make the window appear on the frame and enable display, |
| 2149 | unless the caller says not to. */ | 2188 | unless the caller says not to. */ |
| 2150 | { | 2189 | { |