Commit 689004fa authored by Geoff Voelker's avatar Geoff Voelker
Browse files

(SIF_*): Win95 macros defined for NT.

(struct tagSCROLLINFO): Win95 struct defined for NT.
(vertical_scroll_bar_min_handle, vertical_scroll_bar_top_border,
vertical_scroll_bar_bottom_border, last_scroll_bar_drag_pos,
Vw32_gab_focus_on_raise, Vw32_capslock_is_shiftlock): New
variables.
(w32_frame_up_to_date): Block input.
(do_line_dance): Use DC while erasing, release at end.
(show_mouse_face): Use column and endcolumn calculated at start of
loop.
(my_create_scrollbar, my_show_window, my_set_window_pos,
my_set_focus) [! ATTACH_THREADS]: Send message to window instead
of invoking Windows procedure.
(x_scroll_bar_create, x_scroll_bar_move, x_scroll_bar_handle_click,
x_scroll_bar_report_motion): Use SCROLLINFO for proportional handle.
(x_scroll_bar_set_handle): Create proportional sized scroll handle.
(w32_set_vertical_scroll_bar): Size handle according to how much
is showing in window.
(x_scroll_bar_set_report_motion): Use top_range, calculated above.
(x_scroll_bar_clear): Hide scroll bar until ready to repaint.
(show_scroll_bars): Pass in frame to my_show_window.
(w32_read_socket): Distinguish between invisible and obscured frames
when handling PAINT messages.
Fixup off-by-one calculation for PAINT and SIZE.
Pass in new parameter to w32_kbd_mods_to_emacs.
Handle WM_DISPLAYCHANGE, WINDOWPOSCHANGED, ACTIVATE, SHOWWINDOW,
INITMENU, and ACTIVATEAPP messages.
Explicitly check for visibile and obscured frames, and to see if
any event should cause a redisplay.

(x_display_bar_cursor): Don't check whether frame is updating here.
(x_display_cursor): Check it here instead.
(x_set_offset) [HAVE_NTGUI]: Don't add border widths.
Set NOACTIVATE when setting window position.
(x_set_window_size): Fixup off-by-one calculation when setting
window position.  Mark frame garbaged earlier.  Clear mouse
highlighting state.
(x_focus_on_frame): Set focus by making frame the foreground window.
(x_raise_frame): Support frames to be raised without grabbing focus.
(x_lower_frame): Set NOACTIVATE flag when setting window position.
(x_make_frame_visible, x_make_frame_invisible): Pass in frame
to my_show_window.
to my_show_window.
(x_iconify_frame): Send a MINIMIZE message to the window.
(x_wm_set_size_hint): Set font width, line height, border,
and scroll bar indexes instead of X and Y unit indexes.

(w32_initialize): Set input mode.  Use w32_msg_worker instead
of windows_msg_worker.  Dynamically link proportional scroll bar
functions and intialize proportional scroll bar variables.
(syms_of_w32term): DEFVAR new variables.

(construct_mouse_wheel): New function.  Constructs an
input event from a WM_MOUSEWHEEL message.
(w32_read_socket): Handle WM_MOUSEWHEEL.

(w32_read_socket): Pass in new parameter to key_event.
Let key_event determine whether key is dead.
For MOVE, use x_real_positions to map to client coords.
(x_set_mouse_pixel_position): Offset to use client area as origin.
parent b2fc9f3d
......@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
#include "charset.h"
#include "blockinput.h"
#include <w32term.h>
#include "w32term.h"
#include "systty.h"
#include "systime.h"
......@@ -95,6 +95,38 @@ HANDLE hWindowsThread = NULL;
DWORD dwMainThreadId = 0;
HANDLE hMainThread = NULL;
#ifndef SIF_ALL
/* These definitions are new with Windows 95. */
#define SIF_RANGE 0x0001
#define SIF_PAGE 0x0002
#define SIF_POS 0x0004
#define SIF_DISABLENOSCROLL 0x0008
#define SIF_TRACKPOS 0x0010
#define SIF_ALL (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
typedef struct tagSCROLLINFO
{
UINT cbSize;
UINT fMask;
int nMin;
int nMax;
UINT nPage;
int nPos;
int nTrackPos;
} SCROLLINFO, FAR *LPSCROLLINFO;
typedef SCROLLINFO CONST FAR *LPCSCROLLINFO;
#endif /* SIF_ALL */
/* Dynamic linking to new proportional scroll bar functions. */
int (PASCAL *pfnSetScrollInfo) (HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fRedraw);
BOOL (PASCAL *pfnGetScrollInfo) (HWND hwnd, int fnBar, LPSCROLLINFO lpsi);
int vertical_scroll_bar_min_handle;
int vertical_scroll_bar_top_border;
int vertical_scroll_bar_bottom_border;
int last_scroll_bar_drag_pos;
/* Mouse movement. */
/* Where the mouse was last time we reported a mouse event. */
......@@ -105,6 +137,12 @@ Lisp_Object Vw32_num_mouse_buttons;
Lisp_Object Vw32_swap_mouse_buttons;
/* Control whether x_raise_frame also sets input focus. */
Lisp_Object Vw32_grab_focus_on_raise;
/* Control whether Caps Lock affects non-ascii characters. */
Lisp_Object Vw32_capslock_is_shiftlock;
/* The scroll bar in which the last motion event occurred.
If the last motion event occurred in a scroll bar, we set this
......@@ -324,6 +362,7 @@ static
w32_frame_up_to_date (f)
FRAME_PTR f;
{
BLOCK_INPUT;
if (FRAME_W32_DISPLAY_INFO (f)->mouse_face_deferred_gc
|| f == FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_frame)
{
......@@ -332,6 +371,7 @@ w32_frame_up_to_date (f)
FRAME_W32_DISPLAY_INFO (f)->mouse_face_mouse_y);
FRAME_W32_DISPLAY_INFO (f)->mouse_face_deferred_gc = 0;
}
UNBLOCK_INPUT;
}
/* External interface to control of standout mode.
......@@ -875,14 +915,12 @@ do_line_dance ()
i = j+1;
}
release_frame_dc (f, hdc);
for (i = 0; i < ht; ++i)
if (line_dance[i] == -1)
{
for (j = i; j < ht && line_dance[j] == -1; ++j);
/* Clear [i,j) */
w32_clear_area (f, NULL,
w32_clear_area (f, hdc,
intborder,
CHAR_TO_PIXEL_ROW (f, i),
f->width * FONT_WIDTH (f->output_data.w32->font),
......@@ -890,6 +928,8 @@ do_line_dance ()
i = j-1;
}
line_dance_in_progress = 0;
release_frame_dc (f, hdc);
}
/* Support routines for exposure events. */
......@@ -1265,6 +1305,25 @@ construct_mouse_click (result, msg, f)
}
}
static void
construct_mouse_wheel (result, msg, f)
struct input_event *result;
W32Msg *msg;
struct frame *f;
{
POINT p;
result->kind = mouse_wheel;
result->code = (short) HIWORD (msg->msg.wParam);
result->timestamp = msg->msg.time;
result->modifiers = msg->dwModifiers;
p.x = LOWORD (msg->msg.lParam);
p.y = HIWORD (msg->msg.lParam);
ScreenToClient(msg->msg.hwnd, &p);
XSETINT (result->x, p.x);
XSETINT (result->y, p.y);
XSETFRAME (result->frame_or_window, f);
}
/* Function to report a mouse movement to the mainstream Emacs code.
The input handler calls this.
......@@ -1606,8 +1665,8 @@ show_mouse_face (dpyinfo, hl)
/* If the cursor's in the text we are about to rewrite,
turn the cursor off. */
if (i == curs_y
&& curs_x >= FRAME_W32_DISPLAY_INFO (f)->mouse_face_beg_col - 1
&& curs_x <= FRAME_W32_DISPLAY_INFO (f)->mouse_face_end_col)
&& curs_x >= column - 1
&& curs_x <= endcolumn)
{
x_display_cursor (f, 0);
cursor_off = 1;
......@@ -1690,6 +1749,7 @@ w32_mouse_position (fp, insist, bar_window, part, x, y, time)
BLOCK_INPUT;
if (! NILP (last_mouse_scroll_bar))
/* This is never called at the moment. */
x_scroll_bar_report_motion (fp, bar_window, part, x, y, time);
else
{
......@@ -1803,34 +1863,31 @@ my_create_scrollbar (f, bar)
struct frame * f;
struct scroll_bar * bar;
{
MSG msg;
PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
(LPARAM) bar);
GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
return ((HWND) msg.wParam);
return (HWND) SendMessage (FRAME_W32_WINDOW (f),
WM_EMACS_CREATESCROLLBAR, (WPARAM) f,
(LPARAM) bar);
}
//#define ATTACH_THREADS
void
my_show_window (HWND hwnd, int how)
BOOL
my_show_window (FRAME_PTR f, HWND hwnd, int how)
{
#ifndef ATTACH_THREADS
SendMessage (hwnd, WM_EMACS_SHOWWINDOW, (WPARAM) how, 0);
return SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SHOWWINDOW,
(WPARAM) hwnd, (LPARAM) how);
#else
ShowWindow (hwnd , how);
return ShowWindow (hwnd, how);
#endif
}
void
my_set_window_pos (HWND hwnd, HWND hwndAfter,
int x, int y, int cx, int cy, int flags)
int x, int y, int cx, int cy, UINT flags)
{
#ifndef ATTACH_THREADS
W32WindowPos pos;
pos.hwndAfter = hwndAfter;
WINDOWPOS pos;
pos.hwndInsertAfter = hwndAfter;
pos.x = x;
pos.y = y;
pos.cx = cx;
......@@ -1842,6 +1899,15 @@ my_set_window_pos (HWND hwnd, HWND hwndAfter,
#endif
}
BOOL
my_set_focus (f, hwnd)
struct frame * f;
HWND hwnd;
{
SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SETFOCUS,
(WPARAM) hwnd, 0);
}
void
my_destroy_window (f, hwnd)
struct frame * f;
......@@ -1878,8 +1944,25 @@ x_scroll_bar_create (window, top, left, width, height)
hwnd = my_create_scrollbar (f, bar);
SetScrollRange (hwnd, SB_CTL, 0, height, FALSE);
SetScrollPos (hwnd, SB_CTL, 0, TRUE);
if (pfnSetScrollInfo)
{
SCROLLINFO si;
si.cbSize = sizeof (si);
si.fMask = SIF_ALL;
si.nMin = 0;
si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (height)
+ VERTICAL_SCROLL_BAR_MIN_HANDLE;
si.nPage = si.nMax;
si.nPos = 0;
pfnSetScrollInfo (hwnd, SB_CTL, &si, FALSE);
}
else
{
SetScrollRange (hwnd, SB_CTL, 0, VERTICAL_SCROLL_BAR_TOP_RANGE (height), FALSE);
SetScrollPos (hwnd, SB_CTL, 0, FALSE);
}
SET_SCROLL_BAR_W32_WINDOW (bar, hwnd);
......@@ -1924,11 +2007,48 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
BLOCK_INPUT;
{
int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
/* Make sure the values are reasonable, and try to preserve
the distance between start and end. */
{
int length = end - start;
if (start < 0)
start = 0;
else if (start > top_range)
start = top_range;
end = start + length;
if (end < start)
end = start;
else if (end > top_range && ! dragging)
end = top_range;
}
}
/* Store the adjusted setting in the scroll bar. */
XSETINT (bar->start, start);
XSETINT (bar->end, end);
SetScrollPos (w, SB_CTL, start, TRUE);
/* If being dragged, let scroll bar update itself. */
if (!dragging)
{
if (pfnSetScrollInfo)
{
SCROLLINFO si;
si.cbSize = sizeof (si);
si.fMask = SIF_PAGE | SIF_POS;
si.nPage = end - start + VERTICAL_SCROLL_BAR_MIN_HANDLE;
si.nPos = start;
pfnSetScrollInfo (w, SB_CTL, &si, TRUE);
}
else
SetScrollPos (w, SB_CTL, start, TRUE);
}
UNBLOCK_INPUT;
}
......@@ -1943,12 +2063,40 @@ x_scroll_bar_move (bar, top, left, width, height)
Window w = SCROLL_BAR_W32_WINDOW (bar);
FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
/* If already correctly positioned, do nothing. */
if ( XINT (bar->left) == left
&& XINT (bar->top) == top
&& XINT (bar->width) == width
&& XINT (bar->height) == height )
{
/* Redraw after clear_frame. */
if (!my_show_window (f, w, SW_NORMAL))
InvalidateRect (w, NULL, FALSE);
return;
}
BLOCK_INPUT;
/* Make sure scroll bar is "visible" before moving, to ensure the
area of the parent window now exposed will be refreshed. */
my_show_window (f, w, SW_HIDE);
MoveWindow (w, left, top, width, height, TRUE);
SetScrollRange (w, SB_CTL, 0, height, FALSE);
InvalidateRect (w, NULL, FALSE);
my_show_window (w, SW_NORMAL);
if (pfnSetScrollInfo)
{
SCROLLINFO si;
si.cbSize = sizeof (si);
si.fMask = SIF_RANGE;
si.nMin = 0;
si.nMax = VERTICAL_SCROLL_BAR_TOP_RANGE (height)
+ VERTICAL_SCROLL_BAR_MIN_HANDLE;
pfnSetScrollInfo (w, SB_CTL, &si, FALSE);
}
else
SetScrollRange (w, SB_CTL, 0, VERTICAL_SCROLL_BAR_TOP_RANGE (height), FALSE);
my_show_window (f, w, SW_NORMAL);
// InvalidateRect (w, NULL, FALSE);
XSETINT (bar->left, left);
XSETINT (bar->top, top);
......@@ -2014,22 +2162,20 @@ w32_set_vertical_scroll_bar (window, portion, whole, position)
x_scroll_bar_move (bar, pixel_top, pixel_left, pixel_width, pixel_height);
}
/* Set the scroll bar's current state, unless we're currently being
dragged. */
if (NILP (bar->dragging))
{
int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (pixel_height);
/* Set the scroll bar's current state. */
{
int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (pixel_height);
if (whole == 0)
x_scroll_bar_set_handle (bar, 0, top_range, 0);
else
{
int start = (int) (((double) position * top_range) / whole);
int end = (int) (((double) (position + portion) * top_range) / whole);
if (whole == 0)
x_scroll_bar_set_handle (bar, 0, top_range, 0);
else
{
int start = (int) (((double) position * top_range) / whole);
int end = (int) (((double) (position + portion) * top_range) / whole);
x_scroll_bar_set_handle (bar, start, end, 0);
}
}
x_scroll_bar_set_handle (bar, start, end, 0);
}
}
XSETVECTOR (window->vertical_scroll_bar, bar);
}
......@@ -2159,19 +2305,27 @@ x_scroll_bar_handle_click (bar, msg, emacs_event)
emacs_event->timestamp = msg->msg.time;
{
int internal_height
= VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (XINT (bar->height));
int top_range
= VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
int y = GetScrollPos ((HWND) msg->msg.lParam, SB_CTL);
int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
int y;
int dragging = !NILP (bar->dragging);
if (pfnGetScrollInfo)
{
SCROLLINFO si;
si.cbSize = sizeof (si);
si.fMask = SIF_POS;
pfnGetScrollInfo ((HWND) msg->msg.lParam, SB_CTL, &si);
y = si.nPos;
}
else
y = GetScrollPos ((HWND) msg->msg.lParam, SB_CTL);
bar->dragging = Qnil;
switch (LOWORD (msg->msg.wParam))
{
case SB_THUMBTRACK:
emacs_event->part = scroll_bar_handle;
if (VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)) <= 0xffff)
y = HIWORD (msg->msg.wParam);
break;
case SB_LINEDOWN:
emacs_event->part = scroll_bar_down_arrow;
break;
......@@ -2192,12 +2346,76 @@ x_scroll_bar_handle_click (bar, msg, emacs_event)
emacs_event->part = scroll_bar_handle;
y = top_range;
break;
case SB_THUMBTRACK:
case SB_THUMBPOSITION:
if (VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)) <= 0xffff)
y = HIWORD (msg->msg.wParam);
bar->dragging = Qt;
emacs_event->part = scroll_bar_handle;
/* "Silently" update current position. */
if (pfnSetScrollInfo)
{
SCROLLINFO si;
si.cbSize = sizeof (si);
si.fMask = SIF_POS;
#if 0
/* Shrink handle if necessary to allow full range for position. */
{
int start = XINT (bar->start);
int end = XINT (bar->end);
int len = end - start;
/* If new end is nearly hitting bottom, we must shrink
handle. How much we shrink it depends on the relative
sizes of len and top_range. */
if (y + len > top_range - 2)
{
len -= min (top_range / 10, (len / 3) + 2);
if (len < 0)
len = 0;
}
si.nPage = len + VERTICAL_SCROLL_BAR_MIN_HANDLE;
si.fMask |= SIF_PAGE;
}
#endif
si.nPos = y;
/* Remember apparent position (we actually lag behind the real
position, so don't set that directly. */
last_scroll_bar_drag_pos = y;
pfnSetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, FALSE);
}
else
SetScrollPos (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, y, FALSE);
break;
case SB_ENDSCROLL:
/* If this is the end of a drag sequence, then reset the scroll
handle size to normal and do a final redraw. Otherwise do
nothing. */
if (dragging)
{
if (pfnSetScrollInfo)
{
SCROLLINFO si;
int start = XINT (bar->start);
int end = XINT (bar->end);
si.cbSize = sizeof (si);
si.fMask = SIF_PAGE | SIF_POS;
si.nPage = end - start + VERTICAL_SCROLL_BAR_MIN_HANDLE;
si.nPos = last_scroll_bar_drag_pos;
pfnSetScrollInfo (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, &si, TRUE);
}
else
SetScrollPos (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, y, TRUE);
}
/* fall through */
default:
SetScrollPos (SCROLL_BAR_W32_WINDOW (bar), SB_CTL, y, TRUE);
emacs_event->kind = no_event;
return FALSE;
}
......@@ -2222,13 +2440,26 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
Window w = SCROLL_BAR_W32_WINDOW (bar);
FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
int pos;
int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height));
BLOCK_INPUT;
*fp = f;
*bar_window = bar->window;
pos = GetScrollPos (w, SB_CTL);
if (pfnGetScrollInfo)
{
SCROLLINFO si;
si.cbSize = sizeof (si);
si.fMask = SIF_POS | SIF_PAGE | SIF_RANGE;
pfnGetScrollInfo (w, SB_CTL, &si);
pos = si.nPos;
top_range = si.nMax - si.nPage + 1;
}
else
pos = GetScrollPos (w, SB_CTL);
switch (LOWORD (last_mouse_scroll_bar_pos))
{
......@@ -2248,7 +2479,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
}
XSETINT(*x, pos);
XSETINT(*y, VERTICAL_SCROLL_BAR_TOP_RANGE (XINT (bar->height)));
XSETINT(*y, top_range);
f->mouse_moved = 0;
last_mouse_scroll_bar = Qnil;
......@@ -2275,11 +2506,16 @@ x_scroll_bar_clear (f)
HDC hdc = GetDC (window);
RECT rect;
my_show_window (window, SW_HIDE);
/* Hide scroll bar until ready to repaint. x_scroll_bar_move
arranges to refresh the scroll bar if hidden. */
my_show_window (f, window, SW_HIDE);
GetClientRect (window, &rect);
select_palette (f, hdc);
w32_clear_rect (f, hdc, &rect);
deselect_palette (f, hdc);
ReleaseDC (window, hdc);
}
}
......@@ -2293,7 +2529,7 @@ show_scroll_bars (f, how)
bar = XSCROLL_BAR (bar)->next)
{
HWND window = SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar));
my_show_window (window, how);
my_show_window (f, window, how);
}
}
......@@ -2310,7 +2546,7 @@ static Time enter_timestamp;
int temp_index;
short temp_buffer[100];
extern int key_event (KEY_EVENT_RECORD *, struct input_event *);
extern int key_event (KEY_EVENT_RECORD *, struct input_event *, int *isdead);
/* Map a W32 WM_CHAR message into a KEY_EVENT_RECORD so that
we can use the same routines to handle input in both console
......@@ -2369,12 +2605,9 @@ w32_read_socket (sd, bufp, numchars, expected)
int expected;
{
int count = 0;
int nbytes = 0;
int items_pending; /* How many items are in the X queue. */
int check_visibility = 0;
W32Msg msg;
struct frame *f;
int event_found = 0;
int prefix;
Lisp_Object part;
struct w32_display_info *dpyinfo = &one_w32_display_info;
......@@ -2398,16 +2631,34 @@ w32_read_socket (sd, bufp, numchars, expected)
switch (msg.msg.message)
{
case WM_PAINT:
{
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f)
{
if (f->async_visible == 0)
if (f->async_visible != 1)
{
/* Definitely not obscured, so mark as visible. */
f->async_visible = 1;
f->async_iconified = 0;
SET_FRAME_GARBAGED (f);
DebPrint (("frame %04x (%s) reexposed\n", f,
XSTRING (f->name)->data));
/* WM_PAINT serves as MapNotify as well, so report
visibility changes properly. */
if (f->iconified)
{
bufp->kind = deiconify_event;
XSETFRAME (bufp->frame_or_window, f);
bufp++;
count++;
numchars--;
}
else if (! NILP(Vframe_list)
&& ! NILP (XCONS (Vframe_list)->cdr))
/* Force a redisplay sooner or later to update the
frame titles in case this is the second frame. */
record_asynch_buffer_change ();
}
else
{
......@@ -2416,12 +2667,12 @@ w32_read_socket (sd, bufp, numchars, expected)
dumprectangle (f,
msg.rect.left,
msg.rect.top,
msg.rect.right-msg.rect.left+1,
msg.rect.bottom-msg.rect.top+1);
msg.rect.right - msg.rect.left,
msg.rect.bottom - msg.rect.top);
}
}
}
break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
......@@ -2433,7 +2684,8 @@ w32_read_socket (sd, bufp, numchars, expected)
temp_buffer[temp_index++] = msg.msg.wParam;
bufp->kind = non_ascii_keystroke;
bufp->code = msg.msg.wParam;
bufp->modifiers = w32_kbd_mods_to_emacs (msg.dwModifiers);
bufp->modifiers = w32_kbd_mods_to_emacs (msg.dwModifiers,
msg.msg.wParam);
XSETFRAME (bufp->frame_or_window, f);
bufp->timestamp = msg.msg.time;
bufp++;
......@@ -2441,6 +2693,7 @@ w32_read_socket (sd, bufp, numchars, expected)
count++;
}
break;
case WM_SYSCHAR:
case WM_CHAR:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
......@@ -2450,13 +2703,14 @@ w32_read_socket (sd, bufp, numchars, expected)
if (numchars > 1)
{
int add;
int isdead = 0;
KEY_EVENT_RECORD key, *keyp = &key;
if (temp_index == sizeof temp_buffer / sizeof (short))