[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/w32fns.c
From: |
Jason Rumney |
Subject: |
[Emacs-diffs] Changes to emacs/src/w32fns.c |
Date: |
Sat, 01 Dec 2001 06:13:25 -0500 |
Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.142 emacs/src/w32fns.c:1.143
*** emacs/src/w32fns.c:1.142 Fri Nov 30 20:27:00 2001
--- emacs/src/w32fns.c Sat Dec 1 06:13:25 2001
***************
*** 53,62 ****
#include <ctype.h>
extern void free_frame_menubar ();
! extern void x_compute_fringe_widths (struct frame *, int);
extern double atof ();
! extern int w32_console_toggle_lock_key (int vk_code, Lisp_Object new_state);
! extern void w32_menu_display_help (HWND owner, HMENU menu, UINT menu_item,
UINT flags);
extern int quit_char;
/* A definition of XColor for non-X frames. */
--- 53,64 ----
#include <ctype.h>
extern void free_frame_menubar ();
! extern void x_compute_fringe_widths P_ ((struct frame *, int));
extern double atof ();
! extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object));
! extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT));
! extern void w32_free_menu_strings P_ ((HWND));
!
extern int quit_char;
/* A definition of XColor for non-X frames. */
***************
*** 280,285 ****
--- 282,291 ----
static W32Msg saved_mouse_move_msg;
static unsigned mouse_move_timer;
+ /* Window that is tracking the mouse. */
+ static HWND track_mouse_window;
+ FARPROC track_mouse_event_fn;
+
/* W95 mousewheel handler */
unsigned int msh_mousewheel = 0;
***************
*** 4581,4588 ****
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
return 0;
- case WM_VSCROLL:
case WM_MOUSEMOVE:
if (XINT (Vw32_mouse_move_interval) <= 0
|| (msg == WM_MOUSEMOVE && button_state == 0))
{
--- 4587,4610 ----
my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
return 0;
case WM_MOUSEMOVE:
+ /* 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
+ 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)
+ {
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof (tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.hwndTrack = hwnd;
+
+ track_mouse_event_fn (&tme);
+ track_mouse_window = hwnd;
+ }
+ case WM_VSCROLL:
if (XINT (Vw32_mouse_move_interval) <= 0
|| (msg == WM_MOUSEMOVE && button_state == 0))
{
***************
*** 4698,4703 ****
--- 4720,4728 ----
case WM_EXITMENULOOP:
f = x_window_to_frame (dpyinfo, hwnd);
+ /* Free memory used by owner-drawn and help-echo strings. */
+ w32_free_menu_strings (hwnd);
+
/* Indicate that menubar can be modified again. */
if (f)
f->output_data.w32->menubar_active = 0;
***************
*** 4808,4813 ****
--- 4833,4842 ----
goto dflt;
#endif
+ case WM_MOUSELEAVE:
+ /* No longer tracking mouse. */
+ track_mouse_window = NULL;
+
case WM_ACTIVATEAPP:
case WM_ACTIVATE:
case WM_WINDOWPOSCHANGED:
***************
*** 8398,8404 ****
struct image *img;
int pixmap_p, mask_p, colors_p;
{
! #if 0
if (pixmap_p && img->pixmap)
{
XFreePixmap (FRAME_X_DISPLAY (f), img->pixmap);
--- 8427,8433 ----
struct image *img;
int pixmap_p, mask_p, colors_p;
{
! #if 0 /* TODO: W32 image support */
if (pixmap_p && img->pixmap)
{
XFreePixmap (FRAME_X_DISPLAY (f), img->pixmap);
***************
*** 13129,13135 ****
frame = Qnil;
GCPRO3 (parms, name, frame);
! f = make_frame (1);
XSETFRAME (frame, f);
buffer = Fget_buffer_create (build_string (" *tip*"));
--- 13158,13166 ----
frame = Qnil;
GCPRO3 (parms, name, frame);
! /* Make a frame without minibuffer nor mode-line. */
! f = make_frame (0);
! f->wants_modeline = 0;
XSETFRAME (frame, f);
buffer = Fget_buffer_create (build_string (" *tip*"));
***************
*** 13256,13263 ****
--- 13287,13301 ----
f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED;
f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
+
window_prompting = x_figure_window_size (f, parms);
+ /* No fringes on tip frame. */
+ f->output_data.w32->fringes_extra = 0;
+ f->output_data.w32->fringe_cols = 0;
+ f->output_data.w32->left_fringe_width = 0;
+ f->output_data.w32->right_fringe_width = 0;
+
if (window_prompting & XNegative)
{
if (window_prompting & YNegative)
***************
*** 14218,14225 ****
--- 14256,14270 ----
void
syms_of_w32fns ()
{
+ HMODULE user32_lib = GetModuleHandle ("user32.dll");
+
/* This is zero if not using MS-Windows. */
w32_in_use = 0;
+
+ /* TrackMouseEvent not available in all versions of Windows, so must load
+ it dynamically. Do it once, here, instead of every time it is used. */
+ track_mouse_event_fn = GetProcAddress (user32_lib, "TrackMouseEvent");
+ track_mouse_window = NULL;
/* The section below is built by the lisp expression at the top of the file,
just above where these variables are declared. */
- [Emacs-diffs] Changes to emacs/src/w32fns.c,
Jason Rumney <=