--- w32fns.c 27 Jul 2006 22:00:10 +0200 1.272 +++ w32fns.c 01 Aug 2006 22:02:00 +0200 @@ -2066,7 +2066,8 @@ { HWND hwnd; RECT rect; - Lisp_Object top, left; + Lisp_Object top = Qunbound; + Lisp_Object left = Qunbound; rect.left = rect.top = 0; rect.right = FRAME_PIXEL_WIDTH (f); @@ -2079,13 +2080,27 @@ if (!hprevinst) { + Lisp_Object ifa; + w32_init_class (hinst); + + /* Handle geometry command line option and registry key. */ + ifa = Fsymbol_value (intern ("initial-frame-alist")); + if (CONSP (ifa) && Fassq (Qleft, ifa) + && INTEGERP (XCDR (Fassq (Qleft, ifa)))) + left = XCDR (Fassq (Qleft, ifa)); + if (CONSP (ifa) && Fassq (Qtop, ifa) + && INTEGERP (XCDR (Fassq (Qtop, ifa)))) + top = XCDR (Fassq (Qtop, ifa)); } - /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero - for anything that is not a number and is not Qunbound. */ - left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); - top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + if (EQ (left, Qunbound) && EQ (top, Qunbound)) + { + /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero + for anything that is not a number and is not Qunbound. */ + left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); + top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + } FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS,