/* Graphical user interface functions for the Microsoft W32 API.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Emacs.
return 0;
}
+static void
+signal_user_input ()
+{
+ /* Interrupt any lisp that wants to be interrupted by input. */
+ if (!NILP (Vthrow_on_input))
+ {
+ Vquit_flag = Vthrow_on_input;
+ /* If we're inside a function that wants immediate quits,
+ do it now. */
+ if (immediate_quit && NILP (Vinhibit_quit))
+ {
+ immediate_quit = 0;
+ QUIT;
+ }
+ }
+}
+
+
static void
post_character_message (hwnd, msg, wParam, lParam, modifiers)
HWND hwnd;
to receive C-g to interrupt the lisp thread. */
cancel_all_deferred_msgs ();
}
+ else
+ signal_user_input ();
}
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
}
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
/* Clear message buffer. */
saved_mouse_button_msg.msg.hwnd = 0;
}
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
/* Always clear message buffer and cancel timer. */
saved_mouse_button_msg.msg.hwnd = 0;
BOOL up;
int button;
+ /* Ignore middle and extra buttons as long as the menu is active. */
+ f = x_window_to_frame (dpyinfo, hwnd);
+ if (f && f->output_data.w32->menubar_active)
+ return 0;
+
if (parse_button (msg, HIWORD (wParam), &button, &up))
{
if (up) ReleaseCapture ();
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
/* Need to return true for XBUTTON messages, false for others,
to indicate that we processed the message. */
return (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONUP);
case WM_MOUSEMOVE:
+ /* Ignore mouse movements as long as the menu is active. These
+ movements are processed by the window manager anyway, and
+ it's wrong to handle them as if they happened on the
+ underlying frame. */
+ f = x_window_to_frame (dpyinfo, hwnd);
+ if (f && f->output_data.w32->menubar_active)
+ return 0;
+
/* If the mouse has just moved into the frame, start tracking
it, so we will be notified when it leaves the frame. Mouse
tracking only works under W98 and NT4 and later. On earlier
case WM_MOUSEWHEEL:
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
return 0;
case WM_DROPFILES:
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
return 0;
case WM_TIMER:
if (saved_mouse_button_msg.msg.hwnd)
{
post_msg (&saved_mouse_button_msg);
+ signal_user_input ();
saved_mouse_button_msg.msg.hwnd = 0;
}
KillTimer (hwnd, mouse_button_timer);
{
wmsg.dwModifiers = w32_get_modifiers ();
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
+ signal_user_input ();
return 0;
}
x_wm_set_size_hint (f, window_prompting, 0);
UNBLOCK_INPUT;
- /* Avoid a bug that causes the new frame to never become visible if
- an echo area message is displayed during the following call1. */
- specbind(Qredisplay_dont_pause, Qt);
-
- /* Set up faces after all frame parameters are known. This call
- also merges in face attributes specified for new frames. If we
- don't do this, the `menu' face for instance won't have the right
- colors, and the menu bar won't appear in the specified colors for
- new frames. */
- call1 (Qface_set_after_frame_default, frame);
-
/* Make the window appear on the frame and enable display, unless
the caller says not to. However, with explicit parent, Emacs
cannot control visibility, so don't try. */
AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
FRAME_EXTERNAL_MENU_BAR (f));
- /* Position and size tooltip, and put it in the topmost group. */
+ /* Position and size tooltip, and put it in the topmost group.
+ The add-on of 3 to the 5th argument is a kludge: without it,
+ some fonts cause the last character of the tip to be truncated,
+ for some obscure reason. */
SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
- root_x, root_y, rect.right - rect.left,
+ root_x, root_y, rect.right - rect.left + 3,
rect.bottom - rect.top, SWP_NOACTIVATE);
/* Ensure tooltip is on top of other topmost windows (eg menus). */
***********************************************************************/
DEFUN ("w32-select-font", Fw32_select_font, Sw32_select_font, 0, 2, 0,
- doc: /* Select a font using the W32 font dialog.
-Returns an X font string corresponding to the selection. */)
+ doc: /* Select a font for the named FRAME using the W32 font dialog.
+Returns an X-style font string corresponding to the selection.
+
+If FRAME is omitted or nil, it defaults to the selected frame.
+If INCLUDE-PROPORTIONAL is non-nil, include proportional fonts
+in the font selection dialog. */)
(frame, include_proportional)
Lisp_Object frame, include_proportional;
{