aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorStefan Monnier2014-09-30 19:19:31 -0400
committerStefan Monnier2014-09-30 19:19:31 -0400
commit07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de (patch)
tree222adf06960f86aa8b2f560217d39c9fe39d3996 /src/w32fns.c
parent6aed001ad31d41f028d77e66e597b7b3ab4e31ae (diff)
parentd3b7a90bc2ad20192d1afd23eb1aa6a18ceda569 (diff)
downloademacs-07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de.tar.gz
emacs-07bec0fc67ee0b26685f0ec7f28d9b73f67bf3de.zip
Merge from emacs-24
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 0a8bde1f661..98eb8e9f97b 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1956,13 +1956,12 @@ w32_createhscrollbar (struct frame *f, struct scroll_bar * bar)
1956} 1956}
1957 1957
1958static void 1958static void
1959w32_createwindow (struct frame *f) 1959w32_createwindow (struct frame *f, int *coords)
1960{ 1960{
1961 HWND hwnd; 1961 HWND hwnd;
1962 RECT rect; 1962 RECT rect;
1963 Lisp_Object top = Qunbound; 1963 int top;
1964 Lisp_Object left = Qunbound; 1964 int left;
1965 struct w32_display_info *dpyinfo = &one_w32_display_info;
1966 1965
1967 rect.left = rect.top = 0; 1966 rect.left = rect.top = 0;
1968 rect.right = FRAME_PIXEL_WIDTH (f); 1967 rect.right = FRAME_PIXEL_WIDTH (f);
@@ -1977,25 +1976,21 @@ w32_createwindow (struct frame *f)
1977 1976
1978 if (f->size_hint_flags & USPosition || f->size_hint_flags & PPosition) 1977 if (f->size_hint_flags & USPosition || f->size_hint_flags & PPosition)
1979 { 1978 {
1980 XSETINT (left, f->left_pos); 1979 left = f->left_pos;
1981 XSETINT (top, f->top_pos); 1980 top = f->top_pos;
1982 } 1981 }
1983 else if (EQ (left, Qunbound) && EQ (top, Qunbound)) 1982 else
1984 { 1983 {
1985 /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero 1984 left = coords[0];
1986 for anything that is not a number and is not Qunbound. */ 1985 top = coords[1];
1987 left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
1988 top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER);
1989 } 1986 }
1990 1987
1991 FRAME_W32_WINDOW (f) = hwnd 1988 FRAME_W32_WINDOW (f) = hwnd
1992 = CreateWindow (EMACS_CLASS, 1989 = CreateWindow (EMACS_CLASS,
1993 f->namebuf, 1990 f->namebuf,
1994 f->output_data.w32->dwStyle | WS_CLIPCHILDREN, 1991 f->output_data.w32->dwStyle | WS_CLIPCHILDREN,
1995 EQ (left, Qunbound) ? CW_USEDEFAULT : XINT (left), 1992 left, top,
1996 EQ (top, Qunbound) ? CW_USEDEFAULT : XINT (top), 1993 rect.right - rect.left, rect.bottom - rect.top,
1997 rect.right - rect.left,
1998 rect.bottom - rect.top,
1999 NULL, 1994 NULL,
2000 NULL, 1995 NULL,
2001 hinst, 1996 hinst,
@@ -2516,7 +2511,8 @@ w32_msg_pump (deferred_msg * msg_buf)
2516 the patch for XP is not publicly available until XP SP3, 2511 the patch for XP is not publicly available until XP SP3,
2517 and older versions will never be patched. */ 2512 and older versions will never be patched. */
2518 CoInitialize (NULL); 2513 CoInitialize (NULL);
2519 w32_createwindow ((struct frame *) msg.wParam); 2514 w32_createwindow ((struct frame *) msg.wParam,
2515 (int *) msg.lParam);
2520 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) 2516 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
2521 emacs_abort (); 2517 emacs_abort ();
2522 break; 2518 break;
@@ -4136,8 +4132,25 @@ static void
4136my_create_window (struct frame * f) 4132my_create_window (struct frame * f)
4137{ 4133{
4138 MSG msg; 4134 MSG msg;
4135 static int coords[2];
4136 Lisp_Object left, top;
4137 struct w32_display_info *dpyinfo = &one_w32_display_info;
4138
4139 /* When called with RES_TYPE_NUMBER, x_get_arg will return zero for
4140 anything that is not a number and is not Qunbound. */
4141 left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
4142 top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER);
4143 if (EQ (left, Qunbound))
4144 coords[0] = CW_USEDEFAULT;
4145 else
4146 coords[0] = XINT (left);
4147 if (EQ (top, Qunbound))
4148 coords[1] = CW_USEDEFAULT;
4149 else
4150 coords[1] = XINT (top);
4139 4151
4140 if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW, (WPARAM)f, 0)) 4152 if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW,
4153 (WPARAM)f, (LPARAM)coords))
4141 emacs_abort (); 4154 emacs_abort ();
4142 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); 4155 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
4143} 4156}