summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c55
1 files changed, 37 insertions, 18 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 8bc61d15ef6..4ef075f715b 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5501,6 +5501,11 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0;
}
+/* This function is called from the main (a.k.a. "Lisp") thread, and
+ prepares the coordinates to be used by w32_createwindow (which runs
+ in the input thread), when necessary. The calls to
+ gui_display_get_arg must be done here, because they can cons Lisp
+ objects, and that can only be done in the Lisp thread. */
static void
my_create_window (struct frame * f)
{
@@ -5509,20 +5514,33 @@ my_create_window (struct frame * f)
Lisp_Object left, top;
struct w32_display_info *dpyinfo = &one_w32_display_info;
- /* When called with RES_TYPE_NUMBER, gui_display_get_arg will return
- zero for anything that is not a number and is not Qunbound. */
- left = gui_display_get_arg (dpyinfo, Qnil, Qleft, "left", "Left",
- RES_TYPE_NUMBER);
- top = gui_display_get_arg (dpyinfo, Qnil, Qtop, "top", "Top",
- RES_TYPE_NUMBER);
- if (EQ (left, Qunbound))
- coords[0] = CW_USEDEFAULT;
- else
- coords[0] = XFIXNUM (left);
- if (EQ (top, Qunbound))
- coords[1] = CW_USEDEFAULT;
- else
- coords[1] = XFIXNUM (top);
+ /* If f->size_hint_flags is set, it means gui_figure_window_size
+ already processed the 'top' and 'left' frame parameters and set
+ f->top_pos and f->left_pos accordingly. w32_createwindow will
+ then use those value disregarding coords[]. So we don't need to
+ compute coords[] in that case. */
+ if (!(f->size_hint_flags & USPosition || f->size_hint_flags & PPosition))
+ {
+ /* When called with RES_TYPE_NUMBER, and there's no 'top' or
+ 'left' parameters in the frame's parameter alist,
+ gui_display_get_arg will return zero for anything that is
+ neither a number nor Qunbound. If frame parameter alist does
+ have 'left' or 'top', they are interpreted by
+ gui_figure_window_size, which was already called, and which
+ sets f->size_hint_flags. */
+ left = gui_display_get_arg (dpyinfo, Qnil, Qleft, "left", "Left",
+ RES_TYPE_NUMBER);
+ top = gui_display_get_arg (dpyinfo, Qnil, Qtop, "top", "Top",
+ RES_TYPE_NUMBER);
+ if (EQ (left, Qunbound))
+ coords[0] = CW_USEDEFAULT;
+ else
+ coords[0] = XFIXNUM (left);
+ if (EQ (top, Qunbound))
+ coords[1] = CW_USEDEFAULT;
+ else
+ coords[1] = XFIXNUM (top);
+ }
if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW,
(WPARAM)f, (LPARAM)coords))
@@ -8610,7 +8628,8 @@ On Windows 98 and ME, KEY must be a one element key definition in
vector form that would be acceptable to `define-key' (e.g. [A-tab] for
Alt-Tab). The meta modifier is interpreted as Alt if
`w32-alt-is-meta' is t, and hyper is always interpreted as the Windows
-modifier keys. The return value is the hotkey-id if registered, otherwise nil.
+modifier keys. The return value is the hotkey-id if registered,
+otherwise nil.
On Windows versions since NT, KEY can also be specified as [M-], [s-] or
[h-] to indicate that all combinations of that key should be processed
@@ -8618,7 +8637,7 @@ by Emacs instead of the operating system. The super and hyper
modifiers are interpreted according to the current values of
`w32-lwindow-modifier' and `w32-rwindow-modifier'. For instance,
setting `w32-lwindow-modifier' to `super' and then calling
-`(register-hot-key [s-])' grabs all combinations of the left Windows
+`(w32-register-hot-key [s-])' grabs all combinations of the left Windows
key to Emacs, but leaves the right Windows key free for the operating
system keyboard shortcuts. The return value is t if the call affected
any key combinations, otherwise nil. */)
@@ -10214,8 +10233,8 @@ KEY can use either forward- or back-slashes.
To access the default value of KEY (if it is defined), use NAME
that is an empty string.
-If the the named KEY or its subkey called NAME don't exist, or cannot
-be accessed by the current user, the function returns nil. Otherwise,
+If the named KEY or its subkey called NAME don't exist, or cannot be
+accessed by the current user, the function returns nil. Otherwise,
the return value depends on the type of the data stored in Registry:
If the data type is REG_NONE, the function returns t.