/* Graphical user interface functions for the Microsoft Windows API.
-Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc.
+Copyright (C) 1989, 1992-2013 Free Software Foundation, Inc.
This file is part of GNU Emacs.
void globals_of_w32fns (void);
extern void free_frame_menubar (struct frame *);
-extern double atof (const char *);
extern int w32_console_toggle_lock_key (int, Lisp_Object);
extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
extern void w32_free_menu_strings (HWND);
static void w32_hide_hourglass (void);
#ifdef WINDOWSNT
-/* From w32inevet.c */
+/* From w32inevt.c */
extern int faked_key;
#endif /* WINDOWSNT */
/* This gives us version, build, and platform identification. */
OSVERSIONINFO osinfo_cache;
-unsigned long syspage_mask = 0;
+DWORD_PTR syspage_mask = 0;
/* The major and minor versions of NT. */
int w32_major_version;
}
#endif /* EMACSDEBUG */
-/* Here's an overview of how Emacs input works on MS-Windows.
+/* Here's an overview of how Emacs input works in GUI sessions on
+ MS-Windows. (For description of non-GUI input, see the commentary
+ before w32_console_read_socket in w32inevt.c.)
System messages are read and processed by w32_msg_pump below. This
function runs in a separate thread. It handles a small number of
thread-safe. The next line is okay because the cons
cell is never made into garbage and is not relocated by
GC. */
- XSETCAR ((Lisp_Object) ((EMACS_INT) msg.lParam), Qnil);
+ XSETCAR (XIL ((EMACS_INT) msg.lParam), Qnil);
if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
emacs_abort ();
break;
{
int vk_code = (int) msg.wParam;
int cur_state = (GetKeyState (vk_code) & 1);
- Lisp_Object new_state = (Lisp_Object) ((EMACS_INT) msg.lParam);
+ Lisp_Object new_state = XIL ((EMACS_INT) msg.lParam);
/* NB: This code must be thread-safe. It is safe to
call NILP because symbols are not relocated by GC,
versions, there is no way of telling when the mouse leaves the
frame, so we just have to put up with help-echo and mouse
highlighting remaining while the frame is not active. */
- if (track_mouse_event_fn && !track_mouse_window)
+ if (track_mouse_event_fn && !track_mouse_window
+ /* If the menu bar is active, turning on tracking of mouse
+ movement events might send these events to the tooltip
+ frame, if the user happens to move the mouse pointer over
+ the tooltip. But since we don't process events for
+ tooltip frames, this causes Windows to present a
+ hourglass cursor, which is ugly and unexpected. So don't
+ enable tracking mouse events in this case; they will be
+ restarted when the menu pops down. (Confusingly, the
+ menubar_active member of f->output_data.w32, tested
+ above, is only set when a menu was popped up _not_ from
+ the frame's menu bar, but via x-popup-menu.) */
+ && !menubar_in_use)
{
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof (tme);
read-only when "Directories" is selected in the filter. This
allows us to work around the fact that the standard Open File
dialog does not support directories. */
-static UINT CALLBACK
+static UINT_PTR CALLBACK
file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_NOTIFY)
filename = empty_unibyte_string;
#ifdef CYGWIN
- dir = Fcygwin_convert_path_to_windows (dir, Qt);
+ dir = Fcygwin_convert_file_name_to_windows (dir, Qt);
if (SCHARS (filename) > 0)
- filename = Fcygwin_convert_path_to_windows (filename, Qnil);
+ filename = Fcygwin_convert_file_name_to_windows (filename, Qnil);
#endif
CHECK_STRING (dir);
#endif /* NTGUI_UNICODE */
#ifdef CYGWIN
- filename = Fcygwin_convert_path_from_windows (filename, Qt);
+ filename = Fcygwin_convert_file_name_from_windows (filename, Qt);
#endif /* CYGWIN */
/* Strip the dummy filename off the end of the string if we
/* Cache page size, allocation unit, processor type, etc. */
GetSystemInfo (&sysinfo_cache);
- syspage_mask = sysinfo_cache.dwPageSize - 1;
+ syspage_mask = (DWORD_PTR)sysinfo_cache.dwPageSize - 1;
/* Cache os info. */
osinfo_cache.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
break;
}
}
-