diff options
| author | Daniel Colascione | 2012-10-07 14:31:58 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2012-10-07 14:31:58 -0800 |
| commit | 36a305a723c63fd345be65c536c52fe9765c14be (patch) | |
| tree | fb89d9e103552863214c60297a65320917109357 /src/w32term.c | |
| parent | 2ab329f3b5d52a39f0a45c3d9c129f1c19560142 (diff) | |
| parent | 795b1482a9e314cda32d62ac2988f573d359366e (diff) | |
| download | emacs-36a305a723c63fd345be65c536c52fe9765c14be.tar.gz emacs-36a305a723c63fd345be65c536c52fe9765c14be.zip | |
Merge from trunk
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 145 |
1 files changed, 71 insertions, 74 deletions
diff --git a/src/w32term.c b/src/w32term.c index af075955e2c..627ff54394b 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -109,7 +109,7 @@ struct w32_display_info *x_display_list; | |||
| 109 | Lisp_Object w32_display_name_list; | 109 | Lisp_Object w32_display_name_list; |
| 110 | 110 | ||
| 111 | 111 | ||
| 112 | #if !defined (GLYPHSET) && _WIN32_WINNT < 0x500 | 112 | #if _WIN32_WINNT < 0x0500 |
| 113 | /* Pre Windows 2000, this was not available, but define it here so | 113 | /* Pre Windows 2000, this was not available, but define it here so |
| 114 | that Emacs compiled on such a platform will run on newer versions. */ | 114 | that Emacs compiled on such a platform will run on newer versions. */ |
| 115 | 115 | ||
| @@ -211,7 +211,7 @@ static void w32_define_cursor (Window, Cursor); | |||
| 211 | 211 | ||
| 212 | void x_lower_frame (struct frame *); | 212 | void x_lower_frame (struct frame *); |
| 213 | void x_scroll_bar_clear (struct frame *); | 213 | void x_scroll_bar_clear (struct frame *); |
| 214 | void x_wm_set_size_hint (struct frame *, long, int); | 214 | void x_wm_set_size_hint (struct frame *, long, bool); |
| 215 | void x_raise_frame (struct frame *); | 215 | void x_raise_frame (struct frame *); |
| 216 | void x_set_window_size (struct frame *, int, int, int); | 216 | void x_set_window_size (struct frame *, int, int, int); |
| 217 | void x_wm_set_window_state (struct frame *, int); | 217 | void x_wm_set_window_state (struct frame *, int); |
| @@ -374,7 +374,11 @@ w32_draw_underwave (struct glyph_string *s, COLORREF color) | |||
| 374 | 374 | ||
| 375 | /* Find and set clipping rectangle */ | 375 | /* Find and set clipping rectangle */ |
| 376 | 376 | ||
| 377 | wave_clip = (XRectangle){ x0, y0, width, wave_height }; | 377 | wave_clip.x = x0; |
| 378 | wave_clip.y = y0; | ||
| 379 | wave_clip.width = width; | ||
| 380 | wave_clip.height = wave_height; | ||
| 381 | |||
| 378 | get_glyph_string_clip_rect (s, &w32_string_clip); | 382 | get_glyph_string_clip_rect (s, &w32_string_clip); |
| 379 | CONVERT_TO_XRECT (string_clip, w32_string_clip); | 383 | CONVERT_TO_XRECT (string_clip, w32_string_clip); |
| 380 | 384 | ||
| @@ -577,7 +581,7 @@ x_update_window_begin (struct window *w) | |||
| 577 | updated_window = w; | 581 | updated_window = w; |
| 578 | set_output_cursor (&w->cursor); | 582 | set_output_cursor (&w->cursor); |
| 579 | 583 | ||
| 580 | BLOCK_INPUT; | 584 | block_input (); |
| 581 | 585 | ||
| 582 | if (f == hlinfo->mouse_face_mouse_frame) | 586 | if (f == hlinfo->mouse_face_mouse_frame) |
| 583 | { | 587 | { |
| @@ -616,7 +620,7 @@ x_update_window_begin (struct window *w) | |||
| 616 | #endif /* 0 */ | 620 | #endif /* 0 */ |
| 617 | } | 621 | } |
| 618 | 622 | ||
| 619 | UNBLOCK_INPUT; | 623 | unblock_input (); |
| 620 | } | 624 | } |
| 621 | 625 | ||
| 622 | /* Draw a vertical window border from (x,y0) to (x,y1) */ | 626 | /* Draw a vertical window border from (x,y0) to (x,y1) */ |
| @@ -666,7 +670,7 @@ x_update_window_end (struct window *w, int cursor_on_p, | |||
| 666 | 670 | ||
| 667 | if (!w->pseudo_window_p) | 671 | if (!w->pseudo_window_p) |
| 668 | { | 672 | { |
| 669 | BLOCK_INPUT; | 673 | block_input (); |
| 670 | 674 | ||
| 671 | if (cursor_on_p) | 675 | if (cursor_on_p) |
| 672 | display_and_set_cursor (w, 1, output_cursor.hpos, | 676 | display_and_set_cursor (w, 1, output_cursor.hpos, |
| @@ -676,7 +680,7 @@ x_update_window_end (struct window *w, int cursor_on_p, | |||
| 676 | if (draw_window_fringes (w, 1)) | 680 | if (draw_window_fringes (w, 1)) |
| 677 | x_draw_vertical_border (w); | 681 | x_draw_vertical_border (w); |
| 678 | 682 | ||
| 679 | UNBLOCK_INPUT; | 683 | unblock_input (); |
| 680 | } | 684 | } |
| 681 | 685 | ||
| 682 | /* If a row with mouse-face was overwritten, arrange for | 686 | /* If a row with mouse-face was overwritten, arrange for |
| @@ -728,13 +732,13 @@ w32_frame_up_to_date (struct frame *f) | |||
| 728 | if (hlinfo->mouse_face_deferred_gc | 732 | if (hlinfo->mouse_face_deferred_gc |
| 729 | || f == hlinfo->mouse_face_mouse_frame) | 733 | || f == hlinfo->mouse_face_mouse_frame) |
| 730 | { | 734 | { |
| 731 | BLOCK_INPUT; | 735 | block_input (); |
| 732 | if (hlinfo->mouse_face_mouse_frame) | 736 | if (hlinfo->mouse_face_mouse_frame) |
| 733 | note_mouse_highlight (hlinfo->mouse_face_mouse_frame, | 737 | note_mouse_highlight (hlinfo->mouse_face_mouse_frame, |
| 734 | hlinfo->mouse_face_mouse_x, | 738 | hlinfo->mouse_face_mouse_x, |
| 735 | hlinfo->mouse_face_mouse_y); | 739 | hlinfo->mouse_face_mouse_y); |
| 736 | hlinfo->mouse_face_deferred_gc = 0; | 740 | hlinfo->mouse_face_deferred_gc = 0; |
| 737 | UNBLOCK_INPUT; | 741 | unblock_input (); |
| 738 | } | 742 | } |
| 739 | } | 743 | } |
| 740 | } | 744 | } |
| @@ -775,7 +779,7 @@ x_after_update_window_line (struct glyph_row *desired_row) | |||
| 775 | { | 779 | { |
| 776 | int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); | 780 | int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); |
| 777 | 781 | ||
| 778 | BLOCK_INPUT; | 782 | block_input (); |
| 779 | { | 783 | { |
| 780 | HDC hdc = get_frame_dc (f); | 784 | HDC hdc = get_frame_dc (f); |
| 781 | w32_clear_area (f, hdc, 0, y, width, height); | 785 | w32_clear_area (f, hdc, 0, y, width, height); |
| @@ -783,7 +787,7 @@ x_after_update_window_line (struct glyph_row *desired_row) | |||
| 783 | y, width, height); | 787 | y, width, height); |
| 784 | release_frame_dc (f, hdc); | 788 | release_frame_dc (f, hdc); |
| 785 | } | 789 | } |
| 786 | UNBLOCK_INPUT; | 790 | unblock_input (); |
| 787 | } | 791 | } |
| 788 | } | 792 | } |
| 789 | 793 | ||
| @@ -2660,7 +2664,7 @@ x_clear_frame (struct frame *f) | |||
| 2660 | 2664 | ||
| 2661 | /* We don't set the output cursor here because there will always | 2665 | /* We don't set the output cursor here because there will always |
| 2662 | follow an explicit cursor_to. */ | 2666 | follow an explicit cursor_to. */ |
| 2663 | BLOCK_INPUT; | 2667 | block_input (); |
| 2664 | 2668 | ||
| 2665 | w32_clear_window (f); | 2669 | w32_clear_window (f); |
| 2666 | 2670 | ||
| @@ -2668,7 +2672,7 @@ x_clear_frame (struct frame *f) | |||
| 2668 | colors or something like that, then they should be notified. */ | 2672 | colors or something like that, then they should be notified. */ |
| 2669 | x_scroll_bar_clear (f); | 2673 | x_scroll_bar_clear (f); |
| 2670 | 2674 | ||
| 2671 | UNBLOCK_INPUT; | 2675 | unblock_input (); |
| 2672 | } | 2676 | } |
| 2673 | 2677 | ||
| 2674 | 2678 | ||
| @@ -2677,7 +2681,7 @@ x_clear_frame (struct frame *f) | |||
| 2677 | static void | 2681 | static void |
| 2678 | w32_ring_bell (struct frame *f) | 2682 | w32_ring_bell (struct frame *f) |
| 2679 | { | 2683 | { |
| 2680 | BLOCK_INPUT; | 2684 | block_input (); |
| 2681 | 2685 | ||
| 2682 | if (FRAME_W32_P (f) && visible_bell) | 2686 | if (FRAME_W32_P (f) && visible_bell) |
| 2683 | { | 2687 | { |
| @@ -2694,7 +2698,7 @@ w32_ring_bell (struct frame *f) | |||
| 2694 | else | 2698 | else |
| 2695 | w32_sys_ring_bell (f); | 2699 | w32_sys_ring_bell (f); |
| 2696 | 2700 | ||
| 2697 | UNBLOCK_INPUT; | 2701 | unblock_input (); |
| 2698 | } | 2702 | } |
| 2699 | 2703 | ||
| 2700 | 2704 | ||
| @@ -2793,7 +2797,7 @@ x_scroll_run (struct window *w, struct run *run) | |||
| 2793 | expect_dirty = CreateRectRgn (x, y, x + width, to_y); | 2797 | expect_dirty = CreateRectRgn (x, y, x + width, to_y); |
| 2794 | } | 2798 | } |
| 2795 | 2799 | ||
| 2796 | BLOCK_INPUT; | 2800 | block_input (); |
| 2797 | 2801 | ||
| 2798 | /* Cursor off. Will be switched on again in x_update_window_end. */ | 2802 | /* Cursor off. Will be switched on again in x_update_window_end. */ |
| 2799 | updated_window = w; | 2803 | updated_window = w; |
| @@ -2827,7 +2831,7 @@ x_scroll_run (struct window *w, struct run *run) | |||
| 2827 | DeleteObject (combined); | 2831 | DeleteObject (combined); |
| 2828 | } | 2832 | } |
| 2829 | 2833 | ||
| 2830 | UNBLOCK_INPUT; | 2834 | unblock_input (); |
| 2831 | DeleteObject (expect_dirty); | 2835 | DeleteObject (expect_dirty); |
| 2832 | } | 2836 | } |
| 2833 | 2837 | ||
| @@ -3012,9 +3016,9 @@ x_get_keysym_name (int keysym) | |||
| 3012 | /* Make static so we can always return it */ | 3016 | /* Make static so we can always return it */ |
| 3013 | static char value[100]; | 3017 | static char value[100]; |
| 3014 | 3018 | ||
| 3015 | BLOCK_INPUT; | 3019 | block_input (); |
| 3016 | GetKeyNameText (keysym, value, 100); | 3020 | GetKeyNameText (keysym, value, 100); |
| 3017 | UNBLOCK_INPUT; | 3021 | unblock_input (); |
| 3018 | 3022 | ||
| 3019 | return value; | 3023 | return value; |
| 3020 | } | 3024 | } |
| @@ -3322,7 +3326,7 @@ w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, | |||
| 3322 | { | 3326 | { |
| 3323 | FRAME_PTR f1; | 3327 | FRAME_PTR f1; |
| 3324 | 3328 | ||
| 3325 | BLOCK_INPUT; | 3329 | block_input (); |
| 3326 | 3330 | ||
| 3327 | if (! NILP (last_mouse_scroll_bar) && insist == 0) | 3331 | if (! NILP (last_mouse_scroll_bar) && insist == 0) |
| 3328 | x_scroll_bar_report_motion (fp, bar_window, part, x, y, time); | 3332 | x_scroll_bar_report_motion (fp, bar_window, part, x, y, time); |
| @@ -3396,7 +3400,7 @@ w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, | |||
| 3396 | } | 3400 | } |
| 3397 | } | 3401 | } |
| 3398 | 3402 | ||
| 3399 | UNBLOCK_INPUT; | 3403 | unblock_input (); |
| 3400 | } | 3404 | } |
| 3401 | 3405 | ||
| 3402 | 3406 | ||
| @@ -3494,12 +3498,12 @@ w32_set_scroll_bar_thumb (struct scroll_bar *bar, | |||
| 3494 | if (draggingp) | 3498 | if (draggingp) |
| 3495 | { | 3499 | { |
| 3496 | int near_bottom_p; | 3500 | int near_bottom_p; |
| 3497 | BLOCK_INPUT; | 3501 | block_input (); |
| 3498 | si.cbSize = sizeof (si); | 3502 | si.cbSize = sizeof (si); |
| 3499 | si.fMask = SIF_POS | SIF_PAGE; | 3503 | si.fMask = SIF_POS | SIF_PAGE; |
| 3500 | GetScrollInfo (w, SB_CTL, &si); | 3504 | GetScrollInfo (w, SB_CTL, &si); |
| 3501 | near_bottom_p = si.nPos + si.nPage >= range; | 3505 | near_bottom_p = si.nPos + si.nPage >= range; |
| 3502 | UNBLOCK_INPUT; | 3506 | unblock_input (); |
| 3503 | if (!near_bottom_p) | 3507 | if (!near_bottom_p) |
| 3504 | return; | 3508 | return; |
| 3505 | } | 3509 | } |
| @@ -3528,7 +3532,7 @@ w32_set_scroll_bar_thumb (struct scroll_bar *bar, | |||
| 3528 | 3532 | ||
| 3529 | sb_page = max (sb_page, VERTICAL_SCROLL_BAR_MIN_HANDLE); | 3533 | sb_page = max (sb_page, VERTICAL_SCROLL_BAR_MIN_HANDLE); |
| 3530 | 3534 | ||
| 3531 | BLOCK_INPUT; | 3535 | block_input (); |
| 3532 | 3536 | ||
| 3533 | si.cbSize = sizeof (si); | 3537 | si.cbSize = sizeof (si); |
| 3534 | si.fMask = SIF_PAGE | SIF_POS; | 3538 | si.fMask = SIF_PAGE | SIF_POS; |
| @@ -3537,7 +3541,7 @@ w32_set_scroll_bar_thumb (struct scroll_bar *bar, | |||
| 3537 | 3541 | ||
| 3538 | SetScrollInfo (w, SB_CTL, &si, TRUE); | 3542 | SetScrollInfo (w, SB_CTL, &si, TRUE); |
| 3539 | 3543 | ||
| 3540 | UNBLOCK_INPUT; | 3544 | unblock_input (); |
| 3541 | } | 3545 | } |
| 3542 | 3546 | ||
| 3543 | 3547 | ||
| @@ -3628,7 +3632,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height) | |||
| 3628 | = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); | 3632 | = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); |
| 3629 | Lisp_Object barobj; | 3633 | Lisp_Object barobj; |
| 3630 | 3634 | ||
| 3631 | BLOCK_INPUT; | 3635 | block_input (); |
| 3632 | 3636 | ||
| 3633 | XSETWINDOW (bar->window, w); | 3637 | XSETWINDOW (bar->window, w); |
| 3634 | XSETINT (bar->top, top); | 3638 | XSETINT (bar->top, top); |
| @@ -3664,7 +3668,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height) | |||
| 3664 | if (! NILP (bar->next)) | 3668 | if (! NILP (bar->next)) |
| 3665 | XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); | 3669 | XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); |
| 3666 | 3670 | ||
| 3667 | UNBLOCK_INPUT; | 3671 | unblock_input (); |
| 3668 | 3672 | ||
| 3669 | return bar; | 3673 | return bar; |
| 3670 | } | 3674 | } |
| @@ -3678,7 +3682,7 @@ x_scroll_bar_remove (struct scroll_bar *bar) | |||
| 3678 | { | 3682 | { |
| 3679 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); | 3683 | FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); |
| 3680 | 3684 | ||
| 3681 | BLOCK_INPUT; | 3685 | block_input (); |
| 3682 | 3686 | ||
| 3683 | /* Destroy the window. */ | 3687 | /* Destroy the window. */ |
| 3684 | my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar)); | 3688 | my_destroy_window (f, SCROLL_BAR_W32_WINDOW (bar)); |
| @@ -3686,7 +3690,7 @@ x_scroll_bar_remove (struct scroll_bar *bar) | |||
| 3686 | /* Dissociate this scroll bar from its window. */ | 3690 | /* Dissociate this scroll bar from its window. */ |
| 3687 | wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil); | 3691 | wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil); |
| 3688 | 3692 | ||
| 3689 | UNBLOCK_INPUT; | 3693 | unblock_input (); |
| 3690 | } | 3694 | } |
| 3691 | 3695 | ||
| 3692 | /* Set the handle of the vertical scroll bar for WINDOW to indicate | 3696 | /* Set the handle of the vertical scroll bar for WINDOW to indicate |
| @@ -3741,7 +3745,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3741 | if (NILP (w->vertical_scroll_bar)) | 3745 | if (NILP (w->vertical_scroll_bar)) |
| 3742 | { | 3746 | { |
| 3743 | HDC hdc; | 3747 | HDC hdc; |
| 3744 | BLOCK_INPUT; | 3748 | block_input (); |
| 3745 | if (width > 0 && height > 0) | 3749 | if (width > 0 && height > 0) |
| 3746 | { | 3750 | { |
| 3747 | hdc = get_frame_dc (f); | 3751 | hdc = get_frame_dc (f); |
| @@ -3751,7 +3755,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3751 | w32_clear_area (f, hdc, left, top, width, height); | 3755 | w32_clear_area (f, hdc, left, top, width, height); |
| 3752 | release_frame_dc (f, hdc); | 3756 | release_frame_dc (f, hdc); |
| 3753 | } | 3757 | } |
| 3754 | UNBLOCK_INPUT; | 3758 | unblock_input (); |
| 3755 | 3759 | ||
| 3756 | bar = x_scroll_bar_create (w, top, sb_left, sb_width, height); | 3760 | bar = x_scroll_bar_create (w, top, sb_left, sb_width, height); |
| 3757 | } | 3761 | } |
| @@ -3779,7 +3783,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3779 | HDC hdc; | 3783 | HDC hdc; |
| 3780 | SCROLLINFO si; | 3784 | SCROLLINFO si; |
| 3781 | 3785 | ||
| 3782 | BLOCK_INPUT; | 3786 | block_input (); |
| 3783 | if (width && height) | 3787 | if (width && height) |
| 3784 | { | 3788 | { |
| 3785 | hdc = get_frame_dc (f); | 3789 | hdc = get_frame_dc (f); |
| @@ -3815,7 +3819,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3815 | XSETINT (bar->width, sb_width); | 3819 | XSETINT (bar->width, sb_width); |
| 3816 | XSETINT (bar->height, height); | 3820 | XSETINT (bar->height, height); |
| 3817 | 3821 | ||
| 3818 | UNBLOCK_INPUT; | 3822 | unblock_input (); |
| 3819 | } | 3823 | } |
| 3820 | } | 3824 | } |
| 3821 | bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; | 3825 | bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; |
| @@ -4057,7 +4061,7 @@ x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, | |||
| 4057 | int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); | 4061 | int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); |
| 4058 | SCROLLINFO si; | 4062 | SCROLLINFO si; |
| 4059 | 4063 | ||
| 4060 | BLOCK_INPUT; | 4064 | block_input (); |
| 4061 | 4065 | ||
| 4062 | *fp = f; | 4066 | *fp = f; |
| 4063 | *bar_window = bar->window; | 4067 | *bar_window = bar->window; |
| @@ -4094,7 +4098,7 @@ x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, | |||
| 4094 | 4098 | ||
| 4095 | *time = last_mouse_movement_time; | 4099 | *time = last_mouse_movement_time; |
| 4096 | 4100 | ||
| 4097 | UNBLOCK_INPUT; | 4101 | unblock_input (); |
| 4098 | } | 4102 | } |
| 4099 | 4103 | ||
| 4100 | 4104 | ||
| @@ -4148,11 +4152,12 @@ static char dbcs_lead = 0; | |||
| 4148 | This routine is called by the SIGIO handler. | 4152 | This routine is called by the SIGIO handler. |
| 4149 | We return as soon as there are no more events to be read. | 4153 | We return as soon as there are no more events to be read. |
| 4150 | 4154 | ||
| 4155 | For an overview of how Emacs input works on MS-Windows, see the | ||
| 4156 | commentary before w32_msg_pump in w32fns.c. | ||
| 4157 | |||
| 4151 | We return the number of characters stored into the buffer, | 4158 | We return the number of characters stored into the buffer, |
| 4152 | thus pretending to be `read'. | 4159 | thus pretending to be `read'. |
| 4153 | 4160 | ||
| 4154 | EXPECTED is nonzero if the caller knows input is available. | ||
| 4155 | |||
| 4156 | Some of these messages are reposted back to the message queue since the | 4161 | Some of these messages are reposted back to the message queue since the |
| 4157 | system calls the windows proc directly in a context where we cannot return | 4162 | system calls the windows proc directly in a context where we cannot return |
| 4158 | the data nor can we guarantee the state we are in. So if we dispatch them | 4163 | the data nor can we guarantee the state we are in. So if we dispatch them |
| @@ -4163,7 +4168,7 @@ static char dbcs_lead = 0; | |||
| 4163 | */ | 4168 | */ |
| 4164 | 4169 | ||
| 4165 | static int | 4170 | static int |
| 4166 | w32_read_socket (struct terminal *terminal, int expected, | 4171 | w32_read_socket (struct terminal *terminal, |
| 4167 | struct input_event *hold_quit) | 4172 | struct input_event *hold_quit) |
| 4168 | { | 4173 | { |
| 4169 | int count = 0; | 4174 | int count = 0; |
| @@ -4174,15 +4179,7 @@ w32_read_socket (struct terminal *terminal, int expected, | |||
| 4174 | Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; | 4179 | Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; |
| 4175 | static char buf[1]; | 4180 | static char buf[1]; |
| 4176 | 4181 | ||
| 4177 | if (interrupt_input_blocked) | 4182 | block_input (); |
| 4178 | { | ||
| 4179 | interrupt_input_pending = 1; | ||
| 4180 | pending_signals = 1; | ||
| 4181 | return -1; | ||
| 4182 | } | ||
| 4183 | |||
| 4184 | interrupt_input_pending = 0; | ||
| 4185 | BLOCK_INPUT; | ||
| 4186 | 4183 | ||
| 4187 | /* So people can tell when we have read the available input. */ | 4184 | /* So people can tell when we have read the available input. */ |
| 4188 | input_signal_count++; | 4185 | input_signal_count++; |
| @@ -4985,7 +4982,7 @@ w32_read_socket (struct terminal *terminal, int expected, | |||
| 4985 | } | 4982 | } |
| 4986 | } | 4983 | } |
| 4987 | 4984 | ||
| 4988 | UNBLOCK_INPUT; | 4985 | unblock_input (); |
| 4989 | return count; | 4986 | return count; |
| 4990 | } | 4987 | } |
| 4991 | 4988 | ||
| @@ -5500,7 +5497,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, | |||
| 5500 | } | 5497 | } |
| 5501 | x_calc_absolute_position (f); | 5498 | x_calc_absolute_position (f); |
| 5502 | 5499 | ||
| 5503 | BLOCK_INPUT; | 5500 | block_input (); |
| 5504 | x_wm_set_size_hint (f, (long) 0, 0); | 5501 | x_wm_set_size_hint (f, (long) 0, 0); |
| 5505 | 5502 | ||
| 5506 | modified_left = f->left_pos; | 5503 | modified_left = f->left_pos; |
| @@ -5511,7 +5508,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, | |||
| 5511 | modified_left, modified_top, | 5508 | modified_left, modified_top, |
| 5512 | 0, 0, | 5509 | 0, 0, |
| 5513 | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); | 5510 | SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); |
| 5514 | UNBLOCK_INPUT; | 5511 | unblock_input (); |
| 5515 | } | 5512 | } |
| 5516 | 5513 | ||
| 5517 | 5514 | ||
| @@ -5552,7 +5549,7 @@ x_set_window_size (struct frame *f, int change_gravity, int cols, int rows) | |||
| 5552 | { | 5549 | { |
| 5553 | int pixelwidth, pixelheight; | 5550 | int pixelwidth, pixelheight; |
| 5554 | 5551 | ||
| 5555 | BLOCK_INPUT; | 5552 | block_input (); |
| 5556 | 5553 | ||
| 5557 | check_frame_size (f, &rows, &cols); | 5554 | check_frame_size (f, &rows, &cols); |
| 5558 | f->scroll_bar_actual_width | 5555 | f->scroll_bar_actual_width |
| @@ -5632,7 +5629,7 @@ x_set_window_size (struct frame *f, int change_gravity, int cols, int rows) | |||
| 5632 | cancel_mouse_face (f); | 5629 | cancel_mouse_face (f); |
| 5633 | #endif | 5630 | #endif |
| 5634 | 5631 | ||
| 5635 | UNBLOCK_INPUT; | 5632 | unblock_input (); |
| 5636 | } | 5633 | } |
| 5637 | 5634 | ||
| 5638 | /* Mouse warping. */ | 5635 | /* Mouse warping. */ |
| @@ -5662,7 +5659,7 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) | |||
| 5662 | RECT rect; | 5659 | RECT rect; |
| 5663 | POINT pt; | 5660 | POINT pt; |
| 5664 | 5661 | ||
| 5665 | BLOCK_INPUT; | 5662 | block_input (); |
| 5666 | 5663 | ||
| 5667 | GetClientRect (FRAME_W32_WINDOW (f), &rect); | 5664 | GetClientRect (FRAME_W32_WINDOW (f), &rect); |
| 5668 | pt.x = rect.left + pix_x; | 5665 | pt.x = rect.left + pix_x; |
| @@ -5671,7 +5668,7 @@ x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) | |||
| 5671 | 5668 | ||
| 5672 | SetCursorPos (pt.x, pt.y); | 5669 | SetCursorPos (pt.x, pt.y); |
| 5673 | 5670 | ||
| 5674 | UNBLOCK_INPUT; | 5671 | unblock_input (); |
| 5675 | } | 5672 | } |
| 5676 | 5673 | ||
| 5677 | 5674 | ||
| @@ -5683,7 +5680,7 @@ x_focus_on_frame (struct frame *f) | |||
| 5683 | struct w32_display_info *dpyinfo = &one_w32_display_info; | 5680 | struct w32_display_info *dpyinfo = &one_w32_display_info; |
| 5684 | 5681 | ||
| 5685 | /* Give input focus to frame. */ | 5682 | /* Give input focus to frame. */ |
| 5686 | BLOCK_INPUT; | 5683 | block_input (); |
| 5687 | #if 0 | 5684 | #if 0 |
| 5688 | /* Try not to change its Z-order if possible. */ | 5685 | /* Try not to change its Z-order if possible. */ |
| 5689 | if (x_window_to_frame (dpyinfo, GetForegroundWindow ())) | 5686 | if (x_window_to_frame (dpyinfo, GetForegroundWindow ())) |
| @@ -5691,7 +5688,7 @@ x_focus_on_frame (struct frame *f) | |||
| 5691 | else | 5688 | else |
| 5692 | #endif | 5689 | #endif |
| 5693 | my_set_foreground_window (FRAME_W32_WINDOW (f)); | 5690 | my_set_foreground_window (FRAME_W32_WINDOW (f)); |
| 5694 | UNBLOCK_INPUT; | 5691 | unblock_input (); |
| 5695 | } | 5692 | } |
| 5696 | 5693 | ||
| 5697 | void | 5694 | void |
| @@ -5703,7 +5700,7 @@ x_unfocus_frame (struct frame *f) | |||
| 5703 | void | 5700 | void |
| 5704 | x_raise_frame (struct frame *f) | 5701 | x_raise_frame (struct frame *f) |
| 5705 | { | 5702 | { |
| 5706 | BLOCK_INPUT; | 5703 | block_input (); |
| 5707 | 5704 | ||
| 5708 | /* Strictly speaking, raise-frame should only change the frame's Z | 5705 | /* Strictly speaking, raise-frame should only change the frame's Z |
| 5709 | order, leaving input focus unchanged. This is reasonable behavior | 5706 | order, leaving input focus unchanged. This is reasonable behavior |
| @@ -5758,19 +5755,19 @@ x_raise_frame (struct frame *f) | |||
| 5758 | my_bring_window_to_top (FRAME_W32_WINDOW (f)); | 5755 | my_bring_window_to_top (FRAME_W32_WINDOW (f)); |
| 5759 | } | 5756 | } |
| 5760 | 5757 | ||
| 5761 | UNBLOCK_INPUT; | 5758 | unblock_input (); |
| 5762 | } | 5759 | } |
| 5763 | 5760 | ||
| 5764 | /* Lower frame F. */ | 5761 | /* Lower frame F. */ |
| 5765 | void | 5762 | void |
| 5766 | x_lower_frame (struct frame *f) | 5763 | x_lower_frame (struct frame *f) |
| 5767 | { | 5764 | { |
| 5768 | BLOCK_INPUT; | 5765 | block_input (); |
| 5769 | my_set_window_pos (FRAME_W32_WINDOW (f), | 5766 | my_set_window_pos (FRAME_W32_WINDOW (f), |
| 5770 | HWND_BOTTOM, | 5767 | HWND_BOTTOM, |
| 5771 | 0, 0, 0, 0, | 5768 | 0, 0, 0, 0, |
| 5772 | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); | 5769 | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); |
| 5773 | UNBLOCK_INPUT; | 5770 | unblock_input (); |
| 5774 | } | 5771 | } |
| 5775 | 5772 | ||
| 5776 | static void | 5773 | static void |
| @@ -5799,7 +5796,7 @@ x_make_frame_visible (struct frame *f) | |||
| 5799 | { | 5796 | { |
| 5800 | Lisp_Object type; | 5797 | Lisp_Object type; |
| 5801 | 5798 | ||
| 5802 | BLOCK_INPUT; | 5799 | block_input (); |
| 5803 | 5800 | ||
| 5804 | type = x_icon_type (f); | 5801 | type = x_icon_type (f); |
| 5805 | if (!NILP (type)) | 5802 | if (!NILP (type)) |
| @@ -5851,7 +5848,7 @@ x_make_frame_visible (struct frame *f) | |||
| 5851 | int count; | 5848 | int count; |
| 5852 | 5849 | ||
| 5853 | /* This must come after we set COUNT. */ | 5850 | /* This must come after we set COUNT. */ |
| 5854 | UNBLOCK_INPUT; | 5851 | unblock_input (); |
| 5855 | 5852 | ||
| 5856 | XSETFRAME (frame, f); | 5853 | XSETFRAME (frame, f); |
| 5857 | 5854 | ||
| @@ -5894,7 +5891,7 @@ x_make_frame_invisible (struct frame *f) | |||
| 5894 | if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) | 5891 | if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) |
| 5895 | FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0; | 5892 | FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0; |
| 5896 | 5893 | ||
| 5897 | BLOCK_INPUT; | 5894 | block_input (); |
| 5898 | 5895 | ||
| 5899 | my_show_window (f, FRAME_W32_WINDOW (f), SW_HIDE); | 5896 | my_show_window (f, FRAME_W32_WINDOW (f), SW_HIDE); |
| 5900 | 5897 | ||
| @@ -5908,7 +5905,7 @@ x_make_frame_invisible (struct frame *f) | |||
| 5908 | f->async_visible = 0; | 5905 | f->async_visible = 0; |
| 5909 | f->async_iconified = 0; | 5906 | f->async_iconified = 0; |
| 5910 | 5907 | ||
| 5911 | UNBLOCK_INPUT; | 5908 | unblock_input (); |
| 5912 | } | 5909 | } |
| 5913 | 5910 | ||
| 5914 | /* Change window state from mapped to iconified. */ | 5911 | /* Change window state from mapped to iconified. */ |
| @@ -5925,7 +5922,7 @@ x_iconify_frame (struct frame *f) | |||
| 5925 | if (f->async_iconified) | 5922 | if (f->async_iconified) |
| 5926 | return; | 5923 | return; |
| 5927 | 5924 | ||
| 5928 | BLOCK_INPUT; | 5925 | block_input (); |
| 5929 | 5926 | ||
| 5930 | type = x_icon_type (f); | 5927 | type = x_icon_type (f); |
| 5931 | if (!NILP (type)) | 5928 | if (!NILP (type)) |
| @@ -5934,7 +5931,7 @@ x_iconify_frame (struct frame *f) | |||
| 5934 | /* Simulate the user minimizing the frame. */ | 5931 | /* Simulate the user minimizing the frame. */ |
| 5935 | SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0); | 5932 | SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0); |
| 5936 | 5933 | ||
| 5937 | UNBLOCK_INPUT; | 5934 | unblock_input (); |
| 5938 | } | 5935 | } |
| 5939 | 5936 | ||
| 5940 | 5937 | ||
| @@ -5946,7 +5943,7 @@ x_free_frame_resources (struct frame *f) | |||
| 5946 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | 5943 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); |
| 5947 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); | 5944 | Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); |
| 5948 | 5945 | ||
| 5949 | BLOCK_INPUT; | 5946 | block_input (); |
| 5950 | 5947 | ||
| 5951 | /* We must free faces before destroying windows because some | 5948 | /* We must free faces before destroying windows because some |
| 5952 | font-driver (e.g. xft) access a window while finishing a | 5949 | font-driver (e.g. xft) access a window while finishing a |
| @@ -5994,7 +5991,7 @@ x_free_frame_resources (struct frame *f) | |||
| 5994 | hlinfo->mouse_face_mouse_frame = 0; | 5991 | hlinfo->mouse_face_mouse_frame = 0; |
| 5995 | } | 5992 | } |
| 5996 | 5993 | ||
| 5997 | UNBLOCK_INPUT; | 5994 | unblock_input (); |
| 5998 | } | 5995 | } |
| 5999 | 5996 | ||
| 6000 | 5997 | ||
| @@ -6014,10 +6011,10 @@ x_destroy_window (struct frame *f) | |||
| 6014 | /* Set the normal size hints for the window manager, for frame F. | 6011 | /* Set the normal size hints for the window manager, for frame F. |
| 6015 | FLAGS is the flags word to use--or 0 meaning preserve the flags | 6012 | FLAGS is the flags word to use--or 0 meaning preserve the flags |
| 6016 | that the window now has. | 6013 | that the window now has. |
| 6017 | If USER_POSITION is nonzero, we set the USPosition | 6014 | If USER_POSITION, set the USPosition |
| 6018 | flag (this is useful when FLAGS is 0). */ | 6015 | flag (this is useful when FLAGS is 0). */ |
| 6019 | void | 6016 | void |
| 6020 | x_wm_set_size_hint (struct frame *f, long flags, int user_position) | 6017 | x_wm_set_size_hint (struct frame *f, long flags, bool user_position) |
| 6021 | { | 6018 | { |
| 6022 | Window window = FRAME_W32_WINDOW (f); | 6019 | Window window = FRAME_W32_WINDOW (f); |
| 6023 | 6020 | ||
| @@ -6278,10 +6275,10 @@ x_delete_terminal (struct terminal *terminal) | |||
| 6278 | if (!terminal->name) | 6275 | if (!terminal->name) |
| 6279 | return; | 6276 | return; |
| 6280 | 6277 | ||
| 6281 | BLOCK_INPUT; | 6278 | block_input (); |
| 6282 | 6279 | ||
| 6283 | x_delete_display (dpyinfo); | 6280 | x_delete_display (dpyinfo); |
| 6284 | UNBLOCK_INPUT; | 6281 | unblock_input (); |
| 6285 | } | 6282 | } |
| 6286 | 6283 | ||
| 6287 | struct w32_display_info * | 6284 | struct w32_display_info * |
| @@ -6291,7 +6288,7 @@ w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 6291 | struct terminal *terminal; | 6288 | struct terminal *terminal; |
| 6292 | HDC hdc; | 6289 | HDC hdc; |
| 6293 | 6290 | ||
| 6294 | BLOCK_INPUT; | 6291 | block_input (); |
| 6295 | 6292 | ||
| 6296 | if (!w32_initialized) | 6293 | if (!w32_initialized) |
| 6297 | { | 6294 | { |
| @@ -6351,7 +6348,7 @@ w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 6351 | the bitmaps. */ | 6348 | the bitmaps. */ |
| 6352 | w32_init_fringe (terminal->rif); | 6349 | w32_init_fringe (terminal->rif); |
| 6353 | 6350 | ||
| 6354 | UNBLOCK_INPUT; | 6351 | unblock_input (); |
| 6355 | 6352 | ||
| 6356 | return dpyinfo; | 6353 | return dpyinfo; |
| 6357 | } | 6354 | } |