Mercurial > emacs
comparison src/w32term.c @ 54171:f6909a416c3f
(w32_read_socket): Remove bufp_r and numcharsp args.
Add hold_quit arg. Rework to use just one, local, inev
input_event. Store inev directly in fifo using
kbd_buffer_store_event_hold. Update count in one place.
Postpone call to gen_help_event until inev is stored; use new
local do_help for this.
Remove local emacs_event in handing of ButtonPress event; just use
inev instead (so no reason to copy it later).
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Fri, 27 Feb 2004 23:49:20 +0000 |
parents | 8d0f80667054 |
children | 61ba665b1e90 b44978264e1d |
comparison
equal
deleted
inserted
replaced
54170:9f3ff0d515be | 54171:f6909a416c3f |
---|---|
4120 | 4120 |
4121 /* Read events coming from the W32 shell. | 4121 /* Read events coming from the W32 shell. |
4122 This routine is called by the SIGIO handler. | 4122 This routine is called by the SIGIO handler. |
4123 We return as soon as there are no more events to be read. | 4123 We return as soon as there are no more events to be read. |
4124 | 4124 |
4125 Events representing keys are stored in buffer BUFP, | |
4126 which can hold up to NUMCHARS characters. | |
4127 We return the number of characters stored into the buffer, | 4125 We return the number of characters stored into the buffer, |
4128 thus pretending to be `read'. | 4126 thus pretending to be `read'. |
4129 | 4127 |
4130 EXPECTED is nonzero if the caller knows input is available. | 4128 EXPECTED is nonzero if the caller knows input is available. |
4131 | 4129 |
4137 which message we are processing since the windows proc gets called | 4135 which message we are processing since the windows proc gets called |
4138 recursively with different messages by the system. | 4136 recursively with different messages by the system. |
4139 */ | 4137 */ |
4140 | 4138 |
4141 int | 4139 int |
4142 w32_read_socket (sd, bufp, numchars, expected) | 4140 w32_read_socket (sd, expected, hold_quit) |
4143 register int sd; | 4141 register int sd; |
4144 /* register */ struct input_event *bufp; | |
4145 /* register */ int numchars; | |
4146 int expected; | 4142 int expected; |
4143 struct input_event *hold_quit; | |
4147 { | 4144 { |
4148 int count = 0; | 4145 int count = 0; |
4149 int check_visibility = 0; | 4146 int check_visibility = 0; |
4150 W32Msg msg; | 4147 W32Msg msg; |
4151 struct frame *f; | 4148 struct frame *f; |
4161 BLOCK_INPUT; | 4158 BLOCK_INPUT; |
4162 | 4159 |
4163 /* So people can tell when we have read the available input. */ | 4160 /* So people can tell when we have read the available input. */ |
4164 input_signal_count++; | 4161 input_signal_count++; |
4165 | 4162 |
4166 if (numchars <= 0) | |
4167 abort (); /* Don't think this happens. */ | |
4168 | |
4169 /* TODO: tool-bars, ghostscript integration, mouse | 4163 /* TODO: tool-bars, ghostscript integration, mouse |
4170 cursors. */ | 4164 cursors. */ |
4171 while (get_next_msg (&msg, FALSE)) | 4165 while (get_next_msg (&msg, FALSE)) |
4172 { | 4166 { |
4167 struct input_event inev; | |
4168 int do_help = 0; | |
4169 | |
4170 EVENT_INIT (inev); | |
4171 inev.kind = NO_EVENT; | |
4172 inev.arg = Qnil; | |
4173 | |
4173 switch (msg.msg.message) | 4174 switch (msg.msg.message) |
4174 { | 4175 { |
4175 case WM_PAINT: | 4176 case WM_PAINT: |
4176 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4177 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4177 | 4178 |
4196 | 4197 |
4197 /* WM_PAINT serves as MapNotify as well, so report | 4198 /* WM_PAINT serves as MapNotify as well, so report |
4198 visibility changes properly. */ | 4199 visibility changes properly. */ |
4199 if (f->iconified) | 4200 if (f->iconified) |
4200 { | 4201 { |
4201 bufp->kind = DEICONIFY_EVENT; | 4202 inev.kind = DEICONIFY_EVENT; |
4202 XSETFRAME (bufp->frame_or_window, f); | 4203 XSETFRAME (inev.frame_or_window, f); |
4203 bufp->arg = Qnil; | |
4204 bufp++; | |
4205 count++; | |
4206 numchars--; | |
4207 } | 4204 } |
4208 else if (! NILP (Vframe_list) | 4205 else if (! NILP (Vframe_list) |
4209 && ! NILP (XCDR (Vframe_list))) | 4206 && ! NILP (XCDR (Vframe_list))) |
4210 /* Force a redisplay sooner or later to update the | 4207 /* Force a redisplay sooner or later to update the |
4211 frame titles in case this is the second frame. */ | 4208 frame titles in case this is the second frame. */ |
4231 /* Generate a language change event. */ | 4228 /* Generate a language change event. */ |
4232 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4229 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4233 | 4230 |
4234 if (f) | 4231 if (f) |
4235 { | 4232 { |
4236 if (numchars == 0) | 4233 inev.kind = LANGUAGE_CHANGE_EVENT; |
4237 abort (); | 4234 XSETFRAME (inev.frame_or_window, f); |
4238 | 4235 inev.code = msg.msg.wParam; |
4239 bufp->kind = LANGUAGE_CHANGE_EVENT; | 4236 inev.modifiers = msg.msg.lParam & 0xffff; |
4240 XSETFRAME (bufp->frame_or_window, f); | |
4241 bufp->arg = Qnil; | |
4242 bufp->code = msg.msg.wParam; | |
4243 bufp->modifiers = msg.msg.lParam & 0xffff; | |
4244 bufp++; | |
4245 count++; | |
4246 numchars--; | |
4247 } | 4237 } |
4248 break; | 4238 break; |
4249 | 4239 |
4250 case WM_KEYDOWN: | 4240 case WM_KEYDOWN: |
4251 case WM_SYSKEYDOWN: | 4241 case WM_SYSKEYDOWN: |
4260 } | 4250 } |
4261 | 4251 |
4262 if (temp_index == sizeof temp_buffer / sizeof (short)) | 4252 if (temp_index == sizeof temp_buffer / sizeof (short)) |
4263 temp_index = 0; | 4253 temp_index = 0; |
4264 temp_buffer[temp_index++] = msg.msg.wParam; | 4254 temp_buffer[temp_index++] = msg.msg.wParam; |
4265 bufp->kind = NON_ASCII_KEYSTROKE_EVENT; | 4255 inev.kind = NON_ASCII_KEYSTROKE_EVENT; |
4266 bufp->code = msg.msg.wParam; | 4256 inev.code = msg.msg.wParam; |
4267 bufp->modifiers = msg.dwModifiers; | 4257 inev.modifiers = msg.dwModifiers; |
4268 XSETFRAME (bufp->frame_or_window, f); | 4258 XSETFRAME (inev.frame_or_window, f); |
4269 bufp->arg = Qnil; | 4259 inev.timestamp = msg.msg.time; |
4270 bufp->timestamp = msg.msg.time; | |
4271 bufp++; | |
4272 numchars--; | |
4273 count++; | |
4274 } | 4260 } |
4275 break; | 4261 break; |
4276 | 4262 |
4277 case WM_SYSCHAR: | 4263 case WM_SYSCHAR: |
4278 case WM_CHAR: | 4264 case WM_CHAR: |
4287 } | 4273 } |
4288 | 4274 |
4289 if (temp_index == sizeof temp_buffer / sizeof (short)) | 4275 if (temp_index == sizeof temp_buffer / sizeof (short)) |
4290 temp_index = 0; | 4276 temp_index = 0; |
4291 temp_buffer[temp_index++] = msg.msg.wParam; | 4277 temp_buffer[temp_index++] = msg.msg.wParam; |
4292 bufp->kind = ASCII_KEYSTROKE_EVENT; | 4278 inev.kind = ASCII_KEYSTROKE_EVENT; |
4293 bufp->code = msg.msg.wParam; | 4279 inev.code = msg.msg.wParam; |
4294 bufp->modifiers = msg.dwModifiers; | 4280 inev.modifiers = msg.dwModifiers; |
4295 XSETFRAME (bufp->frame_or_window, f); | 4281 XSETFRAME (inev.frame_or_window, f); |
4296 bufp->arg = Qnil; | 4282 inev.timestamp = msg.msg.time; |
4297 bufp->timestamp = msg.msg.time; | |
4298 bufp++; | |
4299 numchars--; | |
4300 count++; | |
4301 } | 4283 } |
4302 break; | 4284 break; |
4303 | 4285 |
4304 case WM_MOUSEMOVE: | 4286 case WM_MOUSEMOVE: |
4305 /* Ignore non-movement. */ | 4287 /* Ignore non-movement. */ |
4341 selected now and last mouse movement event was | 4323 selected now and last mouse movement event was |
4342 not in it. Minibuffer window will be selected | 4324 not in it. Minibuffer window will be selected |
4343 iff it is active. */ | 4325 iff it is active. */ |
4344 if (WINDOWP(window) | 4326 if (WINDOWP(window) |
4345 && !EQ (window, last_window) | 4327 && !EQ (window, last_window) |
4346 && !EQ (window, selected_window) | 4328 && !EQ (window, selected_window)) |
4347 && numchars > 0) | |
4348 { | 4329 { |
4349 bufp->kind = SELECT_WINDOW_EVENT; | 4330 inev.kind = SELECT_WINDOW_EVENT; |
4350 bufp->frame_or_window = window; | 4331 inev.frame_or_window = window; |
4351 bufp->arg = Qnil; | |
4352 ++bufp, ++count, --numchars; | |
4353 } | 4332 } |
4354 | 4333 |
4355 last_window=window; | 4334 last_window=window; |
4356 } | 4335 } |
4357 note_mouse_movement (f, &msg.msg); | 4336 note_mouse_movement (f, &msg.msg); |
4365 | 4344 |
4366 /* If the contents of the global variable help_echo_string | 4345 /* If the contents of the global variable help_echo_string |
4367 has changed, generate a HELP_EVENT. */ | 4346 has changed, generate a HELP_EVENT. */ |
4368 if (help_echo_string != previous_help_echo_string || | 4347 if (help_echo_string != previous_help_echo_string || |
4369 (!NILP (help_echo_string) && !STRINGP (help_echo_string) && f->mouse_moved)) | 4348 (!NILP (help_echo_string) && !STRINGP (help_echo_string) && f->mouse_moved)) |
4370 { | 4349 do_help = 1; |
4371 Lisp_Object frame; | 4350 |
4372 int n; | |
4373 | |
4374 if (help_echo_string == Qnil) | |
4375 { | |
4376 help_echo_object = help_echo_window = Qnil; | |
4377 help_echo_pos = -1; | |
4378 } | |
4379 | |
4380 if (f) | |
4381 XSETFRAME (frame, f); | |
4382 else | |
4383 frame = Qnil; | |
4384 | |
4385 any_help_event_p = 1; | |
4386 n = gen_help_event (bufp, numchars, help_echo_string, frame, | |
4387 help_echo_window, help_echo_object, | |
4388 help_echo_pos); | |
4389 bufp += n, count += n, numchars -= n; | |
4390 } | |
4391 break; | 4351 break; |
4392 | 4352 |
4393 case WM_LBUTTONDOWN: | 4353 case WM_LBUTTONDOWN: |
4394 case WM_LBUTTONUP: | 4354 case WM_LBUTTONUP: |
4395 case WM_MBUTTONDOWN: | 4355 case WM_MBUTTONDOWN: |
4399 case WM_XBUTTONDOWN: | 4359 case WM_XBUTTONDOWN: |
4400 case WM_XBUTTONUP: | 4360 case WM_XBUTTONUP: |
4401 { | 4361 { |
4402 /* If we decide we want to generate an event to be seen | 4362 /* If we decide we want to generate an event to be seen |
4403 by the rest of Emacs, we put it here. */ | 4363 by the rest of Emacs, we put it here. */ |
4404 struct input_event emacs_event; | |
4405 int tool_bar_p = 0; | 4364 int tool_bar_p = 0; |
4406 int button; | 4365 int button; |
4407 int up; | 4366 int up; |
4408 | |
4409 emacs_event.kind = NO_EVENT; | |
4410 | 4367 |
4411 if (dpyinfo->grabbed && last_mouse_frame | 4368 if (dpyinfo->grabbed && last_mouse_frame |
4412 && FRAME_LIVE_P (last_mouse_frame)) | 4369 && FRAME_LIVE_P (last_mouse_frame)) |
4413 f = last_mouse_frame; | 4370 f = last_mouse_frame; |
4414 else | 4371 else |
4415 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4372 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4416 | 4373 |
4417 if (f) | 4374 if (f) |
4418 { | 4375 { |
4419 construct_mouse_click (&emacs_event, &msg, f); | 4376 construct_mouse_click (&inev, &msg, f); |
4420 | 4377 |
4421 /* Is this in the tool-bar? */ | 4378 /* Is this in the tool-bar? */ |
4422 if (WINDOWP (f->tool_bar_window) | 4379 if (WINDOWP (f->tool_bar_window) |
4423 && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) | 4380 && WINDOW_TOTAL_LINES (XWINDOW (f->tool_bar_window))) |
4424 { | 4381 { |
4425 Lisp_Object window; | 4382 Lisp_Object window; |
4426 int x = XFASTINT (emacs_event.x); | 4383 int x = XFASTINT (inev.x); |
4427 int y = XFASTINT (emacs_event.y); | 4384 int y = XFASTINT (inev.y); |
4428 | 4385 |
4429 window = window_from_coordinates (f, x, y, 0, 0, 0, 1); | 4386 window = window_from_coordinates (f, x, y, 0, 0, 0, 1); |
4430 | 4387 |
4431 if (EQ (window, f->tool_bar_window)) | 4388 if (EQ (window, f->tool_bar_window)) |
4432 { | 4389 { |
4433 w32_handle_tool_bar_click (f, &emacs_event); | 4390 w32_handle_tool_bar_click (f, &inev); |
4434 tool_bar_p = 1; | 4391 tool_bar_p = 1; |
4435 } | 4392 } |
4436 } | 4393 } |
4437 | 4394 |
4438 if (!tool_bar_p) | 4395 if (tool_bar_p |
4439 if (!dpyinfo->w32_focus_frame | 4396 || (dpyinfo->w32_focus_frame |
4440 || f == dpyinfo->w32_focus_frame | 4397 && f == dpyinfo->w32_focus_frame)) |
4441 && (numchars >= 1)) | 4398 inev.kind = NO_EVENT; |
4442 { | |
4443 construct_mouse_click (bufp, &msg, f); | |
4444 bufp++; | |
4445 count++; | |
4446 numchars--; | |
4447 } | |
4448 } | 4399 } |
4449 | 4400 |
4450 parse_button (msg.msg.message, HIWORD (msg.msg.wParam), | 4401 parse_button (msg.msg.message, HIWORD (msg.msg.wParam), |
4451 &button, &up); | 4402 &button, &up); |
4452 | 4403 |
4480 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4431 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4481 | 4432 |
4482 if (f) | 4433 if (f) |
4483 { | 4434 { |
4484 | 4435 |
4485 if ((!dpyinfo->w32_focus_frame | 4436 if (!dpyinfo->w32_focus_frame |
4486 || f == dpyinfo->w32_focus_frame) | 4437 || f == dpyinfo->w32_focus_frame) |
4487 && (numchars >= 1)) | |
4488 { | 4438 { |
4489 /* Emit an Emacs wheel-up/down event. */ | 4439 /* Emit an Emacs wheel-up/down event. */ |
4490 construct_mouse_wheel (bufp, &msg, f); | 4440 construct_mouse_wheel (&inev, &msg, f); |
4491 bufp++; | |
4492 count++; | |
4493 numchars--; | |
4494 } | 4441 } |
4495 /* Ignore any mouse motion that happened before this | 4442 /* Ignore any mouse motion that happened before this |
4496 event; any subsequent mouse-movement Emacs events | 4443 event; any subsequent mouse-movement Emacs events |
4497 should reflect only motion after the | 4444 should reflect only motion after the |
4498 ButtonPress. */ | 4445 ButtonPress. */ |
4505 | 4452 |
4506 case WM_DROPFILES: | 4453 case WM_DROPFILES: |
4507 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4454 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4508 | 4455 |
4509 if (f) | 4456 if (f) |
4510 { | 4457 construct_drag_n_drop (&inev, &msg, f); |
4511 construct_drag_n_drop (bufp, &msg, f); | |
4512 bufp++; | |
4513 count++; | |
4514 numchars--; | |
4515 } | |
4516 break; | 4458 break; |
4517 | 4459 |
4518 case WM_VSCROLL: | 4460 case WM_VSCROLL: |
4519 { | 4461 { |
4520 struct scroll_bar *bar = | 4462 struct scroll_bar *bar = |
4521 x_window_to_scroll_bar ((HWND)msg.msg.lParam); | 4463 x_window_to_scroll_bar ((HWND)msg.msg.lParam); |
4522 | 4464 |
4523 if (bar && numchars >= 1) | 4465 if (bar) |
4524 { | 4466 w32_scroll_bar_handle_click (bar, &msg, &inev); |
4525 if (w32_scroll_bar_handle_click (bar, &msg, bufp)) | |
4526 { | |
4527 bufp++; | |
4528 count++; | |
4529 numchars--; | |
4530 } | |
4531 } | |
4532 break; | 4467 break; |
4533 } | 4468 } |
4534 | 4469 |
4535 case WM_WINDOWPOSCHANGED: | 4470 case WM_WINDOWPOSCHANGED: |
4536 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4471 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4602 { | 4537 { |
4603 case SIZE_MINIMIZED: | 4538 case SIZE_MINIMIZED: |
4604 f->async_visible = 0; | 4539 f->async_visible = 0; |
4605 f->async_iconified = 1; | 4540 f->async_iconified = 1; |
4606 | 4541 |
4607 bufp->kind = ICONIFY_EVENT; | 4542 inev.kind = ICONIFY_EVENT; |
4608 XSETFRAME (bufp->frame_or_window, f); | 4543 XSETFRAME (inev.frame_or_window, f); |
4609 bufp->arg = Qnil; | |
4610 bufp++; | |
4611 count++; | |
4612 numchars--; | |
4613 break; | 4544 break; |
4614 | 4545 |
4615 case SIZE_MAXIMIZED: | 4546 case SIZE_MAXIMIZED: |
4616 case SIZE_RESTORED: | 4547 case SIZE_RESTORED: |
4617 f->async_visible = 1; | 4548 f->async_visible = 1; |
4632 as the co-ords. */ | 4563 as the co-ords. */ |
4633 x_real_positions (f, &x, &y); | 4564 x_real_positions (f, &x, &y); |
4634 f->left_pos = x; | 4565 f->left_pos = x; |
4635 f->top_pos = y; | 4566 f->top_pos = y; |
4636 | 4567 |
4637 bufp->kind = DEICONIFY_EVENT; | 4568 inev.kind = DEICONIFY_EVENT; |
4638 XSETFRAME (bufp->frame_or_window, f); | 4569 XSETFRAME (inev.frame_or_window, f); |
4639 bufp->arg = Qnil; | |
4640 bufp++; | |
4641 count++; | |
4642 numchars--; | |
4643 } | 4570 } |
4644 else if (! NILP (Vframe_list) | 4571 else if (! NILP (Vframe_list) |
4645 && ! NILP (XCDR (Vframe_list))) | 4572 && ! NILP (XCDR (Vframe_list))) |
4646 /* Force a redisplay sooner or later | 4573 /* Force a redisplay sooner or later |
4647 to update the frame titles | 4574 to update the frame titles |
4705 /* Generate a nil HELP_EVENT to cancel a help-echo. | 4632 /* Generate a nil HELP_EVENT to cancel a help-echo. |
4706 Do it only if there's something to cancel. | 4633 Do it only if there's something to cancel. |
4707 Otherwise, the startup message is cleared when | 4634 Otherwise, the startup message is cleared when |
4708 the mouse leaves the frame. */ | 4635 the mouse leaves the frame. */ |
4709 if (any_help_event_p) | 4636 if (any_help_event_p) |
4710 { | 4637 do_help = -1; |
4711 Lisp_Object frame; | |
4712 int n; | |
4713 | |
4714 XSETFRAME (frame, f); | |
4715 help_echo_string = Qnil; | |
4716 n = gen_help_event (bufp, numchars, | |
4717 Qnil, frame, Qnil, Qnil, 0); | |
4718 bufp += n, count += n, numchars -= n; | |
4719 } | |
4720 } | 4638 } |
4721 break; | 4639 break; |
4722 | 4640 |
4723 case WM_SETFOCUS: | 4641 case WM_SETFOCUS: |
4724 /* TODO: Port this change: | 4642 /* TODO: Port this change: |
4764 /* Generate a nil HELP_EVENT to cancel a help-echo. | 4682 /* Generate a nil HELP_EVENT to cancel a help-echo. |
4765 Do it only if there's something to cancel. | 4683 Do it only if there's something to cancel. |
4766 Otherwise, the startup message is cleared when | 4684 Otherwise, the startup message is cleared when |
4767 the mouse leaves the frame. */ | 4685 the mouse leaves the frame. */ |
4768 if (any_help_event_p) | 4686 if (any_help_event_p) |
4769 { | 4687 do_help = -1; |
4770 Lisp_Object frame; | |
4771 int n; | |
4772 | |
4773 XSETFRAME (frame, f); | |
4774 help_echo_string = Qnil; | |
4775 n = gen_help_event (bufp, numchars, | |
4776 Qnil, frame, Qnil, Qnil, 0); | |
4777 bufp += n, count += n, numchars -=n; | |
4778 } | |
4779 } | 4688 } |
4780 | 4689 |
4781 dpyinfo->grabbed = 0; | 4690 dpyinfo->grabbed = 0; |
4782 check_visibility = 1; | 4691 check_visibility = 1; |
4783 break; | 4692 break; |
4785 case WM_CLOSE: | 4694 case WM_CLOSE: |
4786 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4695 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4787 | 4696 |
4788 if (f) | 4697 if (f) |
4789 { | 4698 { |
4790 if (numchars == 0) | 4699 inev.kind = DELETE_WINDOW_EVENT; |
4791 abort (); | 4700 XSETFRAME (inev.frame_or_window, f); |
4792 | |
4793 bufp->kind = DELETE_WINDOW_EVENT; | |
4794 XSETFRAME (bufp->frame_or_window, f); | |
4795 bufp->arg = Qnil; | |
4796 bufp++; | |
4797 count++; | |
4798 numchars--; | |
4799 } | 4701 } |
4800 break; | 4702 break; |
4801 | 4703 |
4802 case WM_INITMENU: | 4704 case WM_INITMENU: |
4803 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4705 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4804 | 4706 |
4805 if (f) | 4707 if (f) |
4806 { | 4708 { |
4807 if (numchars == 0) | 4709 inev.kind = MENU_BAR_ACTIVATE_EVENT; |
4808 abort (); | 4710 XSETFRAME (inev.frame_or_window, f); |
4809 | |
4810 bufp->kind = MENU_BAR_ACTIVATE_EVENT; | |
4811 XSETFRAME (bufp->frame_or_window, f); | |
4812 bufp->arg = Qnil; | |
4813 bufp++; | |
4814 count++; | |
4815 numchars--; | |
4816 } | 4711 } |
4817 break; | 4712 break; |
4818 | 4713 |
4819 case WM_COMMAND: | 4714 case WM_COMMAND: |
4820 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 4715 f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
4851 /* Forward MSH_MOUSEWHEEL as WM_MOUSEWHEEL. */ | 4746 /* Forward MSH_MOUSEWHEEL as WM_MOUSEWHEEL. */ |
4852 msg.msg.message = WM_MOUSEWHEEL; | 4747 msg.msg.message = WM_MOUSEWHEEL; |
4853 prepend_msg (&msg); | 4748 prepend_msg (&msg); |
4854 } | 4749 } |
4855 break; | 4750 break; |
4751 } | |
4752 | |
4753 if (inev.kind != NO_EVENT) | |
4754 { | |
4755 kbd_buffer_store_event_hold (&inev, hold_quit); | |
4756 count++; | |
4757 } | |
4758 | |
4759 if (do_help | |
4760 && !(hold_quit && hold_quit->kind != NO_EVENT)) | |
4761 { | |
4762 Lisp_Object frame; | |
4763 | |
4764 if (f) | |
4765 XSETFRAME (frame, f); | |
4766 else | |
4767 frame = Qnil; | |
4768 | |
4769 if (do_help > 0) | |
4770 { | |
4771 if (help_echo_string == Qnil) | |
4772 { | |
4773 help_echo_object = help_echo_window = Qnil; | |
4774 help_echo_pos = -1; | |
4775 } | |
4776 | |
4777 any_help_event_p = 1; | |
4778 gen_help_event (help_echo_string, frame, help_echo_window, | |
4779 help_echo_object, help_echo_pos); | |
4780 } | |
4781 else | |
4782 { | |
4783 help_echo_string = Qnil; | |
4784 gen_help_event (Qnil, frame, Qnil, Qnil, 0); | |
4785 } | |
4786 count++; | |
4856 } | 4787 } |
4857 } | 4788 } |
4858 | 4789 |
4859 /* If the focus was just given to an autoraising frame, | 4790 /* If the focus was just given to an autoraising frame, |
4860 raise it now. */ | 4791 raise it now. */ |
5143 { | 5074 { |
5144 /* If the user wants to use the system caret, make sure our own | 5075 /* If the user wants to use the system caret, make sure our own |
5145 cursor remains invisible. */ | 5076 cursor remains invisible. */ |
5146 if (w32_use_visible_system_caret) | 5077 if (w32_use_visible_system_caret) |
5147 { | 5078 { |
5079 /* Call to erase_phys_cursor here seems to use the | |
5080 wrong values of w->phys_cursor, as they have been | |
5081 overwritten before this function was called. */ | |
5148 if (w->phys_cursor_type != NO_CURSOR) | 5082 if (w->phys_cursor_type != NO_CURSOR) |
5149 erase_phys_cursor (w); | 5083 erase_phys_cursor (w); |
5150 | 5084 |
5151 cursor_type = w->phys_cursor_type = NO_CURSOR; | 5085 cursor_type = w->phys_cursor_type = NO_CURSOR; |
5152 w->phys_cursor_width = -1; | 5086 w->phys_cursor_width = -1; |