EnumDisplayMonitors_Proc enum_display_monitors_fn = NULL;
GetTitleBarInfo_Proc get_title_bar_info_fn = NULL;
-#ifdef NTGUI_UNICODE
-#define unicode_append_menu AppendMenuW
-#else /* !NTGUI_UNICODE */
extern AppendMenuW_Proc unicode_append_menu;
-#endif /* NTGUI_UNICODE */
/* Flag to selectively ignore WM_IME_CHAR messages. */
static int ignore_ime_char = 0;
} kbdhook;
typedef HWND (WINAPI *GetConsoleWindow_Proc) (void);
+typedef BOOL (WINAPI *IsDebuggerPresent_Proc) (void);
+
/* stdin, from w32console.c */
extern HANDLE keyboard_handle;
if (border != FRAME_INTERNAL_BORDER_WIDTH (f))
{
- FRAME_INTERNAL_BORDER_WIDTH (f) = border;
+ f->internal_border_width = border;
if (FRAME_X_WINDOW (f) != 0)
{
can prevent this by setting the
w32-pass-[lr]window-to-system variable to
NIL. */
- if (hs->vkCode == (VK_LWIN && !NILP (Vw32_pass_lwindow_to_system)) ||
+ if ((hs->vkCode == VK_LWIN && !NILP (Vw32_pass_lwindow_to_system)) ||
(hs->vkCode == VK_RWIN && !NILP (Vw32_pass_rwindow_to_system)))
{
/* Not prevented - Simulate the keypress to the system. */
{
kbdhook.hook_count++;
+ /* This hook gets in the way of debugging, since when Emacs stops,
+ its input thread stops, and there's nothing to process keyboard
+ events, whereas this hook is global, and is invoked in the
+ context of the thread that installed it. So we don't install the
+ hook if the process is being debugged. */
+ if (w32_kbdhook_active)
+ {
+ IsDebuggerPresent_Proc is_debugger_present = (IsDebuggerPresent_Proc)
+ GetProcAddress (GetModuleHandle ("kernel32.dll"), "IsDebuggerPresent");
+ if (is_debugger_present && is_debugger_present ())
+ return;
+ }
+
/* Hooking is only available on NT architecture systems, as
indicated by the w32_kbdhook_active variable. */
if (kbdhook.hook_count == 1 && w32_kbdhook_active)
}
}
+#ifdef WINDOWSNT
/* Check the current Win key pressed state. */
int
check_w32_winkey_state (int vkey)
}
return 0;
}
+#endif /* WINDOWSNT */
/* Reset the keyboard hook state. Locking the workstation with Win-L
leaves the Win key(s) "down" from the hook's point of view - the
else
return (GetKeyState (vkey) & 0x1);
}
+#ifdef WINDOWSNT
if (w32_kbdhook_active && (vkey == VK_LWIN || vkey == VK_RWIN))
return check_w32_winkey_state (vkey);
+#endif
if (!modifiers_recorded)
return (GetKeyState (vkey) & 0x8000);
ptrdiff_t count = SPECPDL_INDEX ();
ptrdiff_t count_1;
Lisp_Object window, size;
+ AUTO_STRING (tip, " *tip*");
specbind (Qinhibit_redisplay, Qt);
/* Create a frame for the tooltip, and record it in the global
variable tip_frame. */
+ struct frame *f; /* The value is unused. */
if (NILP (tip_frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms)))
{
/* Creating the tip frame failed. */
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);
- AUTO_STRING (tip, " *tip*");
set_window_buffer (window, Fget_buffer_create (tip), false, false);
w = XWINDOW (window);
w->pseudo_window_p = true;
{
/* Filter index: 1: All Files, 2: Directories only */
static const wchar_t filter_w[] = L"All Files (*.*)\0*.*\0Directories\0*|*\0";
+#ifndef NTGUI_UNICODE
static const char filter_a[] = "All Files (*.*)\0*.*\0Directories\0*|*\0";
+#endif
Lisp_Object filename = default_filename;
struct frame *f = SELECTED_FRAME ();
--ret;
buf[ret] = '\0';
if (!ret)
- sprintf (buf, "w32 error %u", error_no);
+ sprintf (buf, "w32 error %d", error_no);
return buf;
}
but not on Windows 7. addr2line doesn't mind a missing
"0x", but will be confused by an extra one. */
if (except_addr)
- sprintf (buf, "\r\nException 0x%lx at this address:\r\n%p\r\n",
- except_code, except_addr);
+ sprintf (buf, "\r\nException 0x%x at this address:\r\n%p\r\n",
+ (unsigned int) except_code, except_addr);
if (stderr_fd >= 0)
{
if (except_addr)