diff options
| author | Joakim Verona | 2013-09-10 23:52:26 +0200 |
|---|---|---|
| committer | Joakim Verona | 2013-09-10 23:52:26 +0200 |
| commit | 63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c (patch) | |
| tree | e5078c5545c777e21944a9ee4199a6f2c6d25ca9 /src/w32term.c | |
| parent | 92aeabcc8a007f521a664e3aee092eb80ad0f49a (diff) | |
| download | emacs-63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c.tar.gz emacs-63dae8e97d343fd4ebfe3dc08f0e8dc932630a4c.zip | |
merge upstream
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 96 |
1 files changed, 22 insertions, 74 deletions
diff --git a/src/w32term.c b/src/w32term.c index ba3aadd0b49..681f70b5888 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -84,9 +84,6 @@ static int last_mousemove_y = 0; | |||
| 84 | 84 | ||
| 85 | static int any_help_event_p; | 85 | static int any_help_event_p; |
| 86 | 86 | ||
| 87 | /* Last window where we saw the mouse. Used by mouse-autoselect-window. */ | ||
| 88 | static Lisp_Object last_window; | ||
| 89 | |||
| 90 | extern unsigned int msh_mousewheel; | 87 | extern unsigned int msh_mousewheel; |
| 91 | 88 | ||
| 92 | extern void free_frame_menubar (struct frame *); | 89 | extern void free_frame_menubar (struct frame *); |
| @@ -224,8 +221,6 @@ void x_wm_set_icon_pixmap (struct frame *, int); | |||
| 224 | static void w32_initialize (void); | 221 | static void w32_initialize (void); |
| 225 | static void x_update_end (struct frame *); | 222 | static void x_update_end (struct frame *); |
| 226 | static void w32_frame_up_to_date (struct frame *); | 223 | static void w32_frame_up_to_date (struct frame *); |
| 227 | static void w32_set_terminal_modes (struct terminal *); | ||
| 228 | static void w32_reset_terminal_modes (struct terminal *); | ||
| 229 | static void x_clear_frame (struct frame *); | 224 | static void x_clear_frame (struct frame *); |
| 230 | static void frame_highlight (struct frame *); | 225 | static void frame_highlight (struct frame *); |
| 231 | static void frame_unhighlight (struct frame *); | 226 | static void frame_unhighlight (struct frame *); |
| @@ -240,7 +235,8 @@ static void x_frame_rehighlight (struct w32_display_info *); | |||
| 240 | static void x_draw_hollow_cursor (struct window *, struct glyph_row *); | 235 | static void x_draw_hollow_cursor (struct window *, struct glyph_row *); |
| 241 | static void x_draw_bar_cursor (struct window *, struct glyph_row *, int, | 236 | static void x_draw_bar_cursor (struct window *, struct glyph_row *, int, |
| 242 | enum text_cursor_kinds); | 237 | enum text_cursor_kinds); |
| 243 | static void w32_clip_to_row (struct window *, struct glyph_row *, int, HDC); | 238 | static void w32_clip_to_row (struct window *, struct glyph_row *, |
| 239 | enum glyph_row_area, HDC); | ||
| 244 | static BOOL my_show_window (struct frame *, HWND, int); | 240 | static BOOL my_show_window (struct frame *, HWND, int); |
| 245 | static void my_set_window_pos (HWND, HWND, int, int, int, int, UINT); | 241 | static void my_set_window_pos (HWND, HWND, int, int, int, int, UINT); |
| 246 | #if 0 | 242 | #if 0 |
| @@ -576,8 +572,7 @@ x_update_begin (struct frame *f) | |||
| 576 | } | 572 | } |
| 577 | 573 | ||
| 578 | 574 | ||
| 579 | /* Start update of window W. Set output_cursor to the cursor | 575 | /* Start update of window W. */ |
| 580 | position of W. */ | ||
| 581 | 576 | ||
| 582 | static void | 577 | static void |
| 583 | x_update_window_begin (struct window *w) | 578 | x_update_window_begin (struct window *w) |
| @@ -591,7 +586,7 @@ x_update_window_begin (struct window *w) | |||
| 591 | SendMessage (w32_system_caret_hwnd, WM_EMACS_HIDE_CARET, 0, 0); | 586 | SendMessage (w32_system_caret_hwnd, WM_EMACS_HIDE_CARET, 0, 0); |
| 592 | } | 587 | } |
| 593 | 588 | ||
| 594 | set_output_cursor (&w->cursor); | 589 | w->output_cursor = w->cursor; |
| 595 | 590 | ||
| 596 | block_input (); | 591 | block_input (); |
| 597 | 592 | ||
| @@ -683,9 +678,9 @@ x_update_window_end (struct window *w, bool cursor_on_p, | |||
| 683 | block_input (); | 678 | block_input (); |
| 684 | 679 | ||
| 685 | if (cursor_on_p) | 680 | if (cursor_on_p) |
| 686 | display_and_set_cursor (w, 1, output_cursor.hpos, | 681 | display_and_set_cursor (w, 1, |
| 687 | output_cursor.vpos, | 682 | w->output_cursor.hpos, w->output_cursor.vpos, |
| 688 | output_cursor.x, output_cursor.y); | 683 | w->output_cursor.x, w->output_cursor.y); |
| 689 | 684 | ||
| 690 | if (draw_window_fringes (w, 1)) | 685 | if (draw_window_fringes (w, 1)) |
| 691 | x_draw_vertical_border (w); | 686 | x_draw_vertical_border (w); |
| @@ -849,7 +844,7 @@ w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row, | |||
| 849 | } | 844 | } |
| 850 | 845 | ||
| 851 | /* Must clip because of partially visible lines. */ | 846 | /* Must clip because of partially visible lines. */ |
| 852 | w32_clip_to_row (w, row, -1, hdc); | 847 | w32_clip_to_row (w, row, ANY_AREA, hdc); |
| 853 | 848 | ||
| 854 | if (p->which && p->which < max_fringe_bmp) | 849 | if (p->which && p->which < max_fringe_bmp) |
| 855 | { | 850 | { |
| @@ -934,28 +929,6 @@ w32_destroy_fringe_bitmap (int which) | |||
| 934 | fringe_bmp[which] = 0; | 929 | fringe_bmp[which] = 0; |
| 935 | } | 930 | } |
| 936 | 931 | ||
| 937 | |||
| 938 | |||
| 939 | /* This is called when starting Emacs and when restarting after | ||
| 940 | suspend. When starting Emacs, no window is mapped. And nothing | ||
| 941 | must be done to Emacs's own window if it is suspended (though that | ||
| 942 | rarely happens). */ | ||
| 943 | |||
| 944 | static void | ||
| 945 | w32_set_terminal_modes (struct terminal *term) | ||
| 946 | { | ||
| 947 | } | ||
| 948 | |||
| 949 | /* This is called when exiting or suspending Emacs. Exiting will make | ||
| 950 | the W32 windows go away, and suspending requires no action. */ | ||
| 951 | |||
| 952 | static void | ||
| 953 | w32_reset_terminal_modes (struct terminal *term) | ||
| 954 | { | ||
| 955 | } | ||
| 956 | |||
| 957 | |||
| 958 | |||
| 959 | /*********************************************************************** | 932 | /*********************************************************************** |
| 960 | Display Iterator | 933 | Display Iterator |
| 961 | ***********************************************************************/ | 934 | ***********************************************************************/ |
| @@ -2651,11 +2624,7 @@ x_clear_frame (struct frame *f) | |||
| 2651 | /* Clearing the frame will erase any cursor, so mark them all as no | 2624 | /* Clearing the frame will erase any cursor, so mark them all as no |
| 2652 | longer visible. */ | 2625 | longer visible. */ |
| 2653 | mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); | 2626 | mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); |
| 2654 | output_cursor.hpos = output_cursor.vpos = 0; | ||
| 2655 | output_cursor.x = -1; | ||
| 2656 | 2627 | ||
| 2657 | /* We don't set the output cursor here because there will always | ||
| 2658 | follow an explicit cursor_to. */ | ||
| 2659 | block_input (); | 2628 | block_input (); |
| 2660 | 2629 | ||
| 2661 | w32_clear_window (f); | 2630 | w32_clear_window (f); |
| @@ -2693,19 +2662,6 @@ w32_ring_bell (struct frame *f) | |||
| 2693 | unblock_input (); | 2662 | unblock_input (); |
| 2694 | } | 2663 | } |
| 2695 | 2664 | ||
| 2696 | |||
| 2697 | /* Specify how many text lines, from the top of the window, | ||
| 2698 | should be affected by insert-lines and delete-lines operations. | ||
| 2699 | This, and those operations, are used only within an update | ||
| 2700 | that is bounded by calls to x_update_begin and x_update_end. */ | ||
| 2701 | |||
| 2702 | static void | ||
| 2703 | w32_set_terminal_window (struct frame *f, int n) | ||
| 2704 | { | ||
| 2705 | /* This function intentionally left blank. */ | ||
| 2706 | } | ||
| 2707 | |||
| 2708 | |||
| 2709 | /*********************************************************************** | 2665 | /*********************************************************************** |
| 2710 | Line Dance | 2666 | Line Dance |
| 2711 | ***********************************************************************/ | 2667 | ***********************************************************************/ |
| @@ -2736,7 +2692,7 @@ x_scroll_run (struct window *w, struct run *run) | |||
| 2736 | /* Get frame-relative bounding box of the text display area of W, | 2692 | /* Get frame-relative bounding box of the text display area of W, |
| 2737 | without mode lines. Include in this box the left and right | 2693 | without mode lines. Include in this box the left and right |
| 2738 | fringes of W. */ | 2694 | fringes of W. */ |
| 2739 | window_box (w, -1, &x, &y, &width, &height); | 2695 | window_box (w, ANY_AREA, &x, &y, &width, &height); |
| 2740 | 2696 | ||
| 2741 | /* If the fringe is adjacent to the left (right) scroll bar of a | 2697 | /* If the fringe is adjacent to the left (right) scroll bar of a |
| 2742 | leftmost (rightmost, respectively) window, then extend its | 2698 | leftmost (rightmost, respectively) window, then extend its |
| @@ -3830,7 +3786,7 @@ w32_set_vertical_scroll_bar (struct window *w, | |||
| 3830 | bool fringe_extended_p; | 3786 | bool fringe_extended_p; |
| 3831 | 3787 | ||
| 3832 | /* Get window dimensions. */ | 3788 | /* Get window dimensions. */ |
| 3833 | window_box (w, -1, 0, &window_y, 0, &window_height); | 3789 | window_box (w, ANY_AREA, 0, &window_y, 0, &window_height); |
| 3834 | top = window_y; | 3790 | top = window_y; |
| 3835 | width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f); | 3791 | width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f); |
| 3836 | height = window_height; | 3792 | height = window_height; |
| @@ -4544,18 +4500,16 @@ w32_read_socket (struct terminal *terminal, | |||
| 4544 | /* Generate SELECT_WINDOW_EVENTs when needed. */ | 4500 | /* Generate SELECT_WINDOW_EVENTs when needed. */ |
| 4545 | if (!NILP (Vmouse_autoselect_window)) | 4501 | if (!NILP (Vmouse_autoselect_window)) |
| 4546 | { | 4502 | { |
| 4547 | Lisp_Object window; | 4503 | static Lisp_Object last_mouse_window; |
| 4548 | int x = LOWORD (msg.msg.lParam); | 4504 | Lisp_Object window = window_from_coordinates |
| 4549 | int y = HIWORD (msg.msg.lParam); | 4505 | (f, LOWORD (msg.msg.lParam), HIWORD (msg.msg.lParam), 0, 0); |
| 4550 | |||
| 4551 | window = window_from_coordinates (f, x, y, 0, 0); | ||
| 4552 | 4506 | ||
| 4553 | /* Window will be selected only when it is not | 4507 | /* Window will be selected only when it is not |
| 4554 | selected now and last mouse movement event was | 4508 | selected now and last mouse movement event was |
| 4555 | not in it. Minibuffer window will be selected | 4509 | not in it. Minibuffer window will be selected |
| 4556 | only when it is active. */ | 4510 | only when it is active. */ |
| 4557 | if (WINDOWP (window) | 4511 | if (WINDOWP (window) |
| 4558 | && !EQ (window, last_window) | 4512 | && !EQ (window, last_mouse_window) |
| 4559 | && !EQ (window, selected_window) | 4513 | && !EQ (window, selected_window) |
| 4560 | /* For click-to-focus window managers | 4514 | /* For click-to-focus window managers |
| 4561 | create event iff we don't leave the | 4515 | create event iff we don't leave the |
| @@ -4567,8 +4521,8 @@ w32_read_socket (struct terminal *terminal, | |||
| 4567 | inev.kind = SELECT_WINDOW_EVENT; | 4521 | inev.kind = SELECT_WINDOW_EVENT; |
| 4568 | inev.frame_or_window = window; | 4522 | inev.frame_or_window = window; |
| 4569 | } | 4523 | } |
| 4570 | 4524 | /* Remember the last window where we saw the mouse. */ | |
| 4571 | last_window = window; | 4525 | last_mouse_window = window; |
| 4572 | } | 4526 | } |
| 4573 | if (!note_mouse_movement (f, &msg.msg)) | 4527 | if (!note_mouse_movement (f, &msg.msg)) |
| 4574 | help_echo_string = previous_help_echo_string; | 4528 | help_echo_string = previous_help_echo_string; |
| @@ -5123,7 +5077,8 @@ w32_read_socket (struct terminal *terminal, | |||
| 5123 | mode lines must be clipped to the whole window. */ | 5077 | mode lines must be clipped to the whole window. */ |
| 5124 | 5078 | ||
| 5125 | static void | 5079 | static void |
| 5126 | w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc) | 5080 | w32_clip_to_row (struct window *w, struct glyph_row *row, |
| 5081 | enum glyph_row_area area, HDC hdc) | ||
| 5127 | { | 5082 | { |
| 5128 | RECT clip_rect; | 5083 | RECT clip_rect; |
| 5129 | int window_x, window_y, window_width; | 5084 | int window_x, window_y, window_width; |
| @@ -6303,11 +6258,6 @@ w32_make_rdb (char *xrm_option) | |||
| 6303 | return buffer; | 6258 | return buffer; |
| 6304 | } | 6259 | } |
| 6305 | 6260 | ||
| 6306 | void | ||
| 6307 | x_flush (struct frame * f) | ||
| 6308 | { /* Nothing to do */ } | ||
| 6309 | |||
| 6310 | |||
| 6311 | extern frame_parm_handler w32_frame_parm_handlers[]; | 6261 | extern frame_parm_handler w32_frame_parm_handlers[]; |
| 6312 | 6262 | ||
| 6313 | static struct redisplay_interface w32_redisplay_interface = | 6263 | static struct redisplay_interface w32_redisplay_interface = |
| @@ -6321,9 +6271,7 @@ static struct redisplay_interface w32_redisplay_interface = | |||
| 6321 | x_after_update_window_line, | 6271 | x_after_update_window_line, |
| 6322 | x_update_window_begin, | 6272 | x_update_window_begin, |
| 6323 | x_update_window_end, | 6273 | x_update_window_end, |
| 6324 | x_cursor_to, | 6274 | 0, /* flush_display */ |
| 6325 | x_flush, | ||
| 6326 | 0, /* flush_display_optional */ | ||
| 6327 | x_clear_window_mouse_face, | 6275 | x_clear_window_mouse_face, |
| 6328 | x_get_glyph_overhangs, | 6276 | x_get_glyph_overhangs, |
| 6329 | x_fix_overlapping_area, | 6277 | x_fix_overlapping_area, |
| @@ -6358,11 +6306,11 @@ w32_create_terminal (struct w32_display_info *dpyinfo) | |||
| 6358 | terminal->ins_del_lines_hook = x_ins_del_lines; | 6306 | terminal->ins_del_lines_hook = x_ins_del_lines; |
| 6359 | terminal->delete_glyphs_hook = x_delete_glyphs; | 6307 | terminal->delete_glyphs_hook = x_delete_glyphs; |
| 6360 | terminal->ring_bell_hook = w32_ring_bell; | 6308 | terminal->ring_bell_hook = w32_ring_bell; |
| 6361 | terminal->reset_terminal_modes_hook = w32_reset_terminal_modes; | 6309 | terminal->reset_terminal_modes_hook = NULL; |
| 6362 | terminal->set_terminal_modes_hook = w32_set_terminal_modes; | 6310 | terminal->set_terminal_modes_hook = NULL; |
| 6363 | terminal->update_begin_hook = x_update_begin; | 6311 | terminal->update_begin_hook = x_update_begin; |
| 6364 | terminal->update_end_hook = x_update_end; | 6312 | terminal->update_end_hook = x_update_end; |
| 6365 | terminal->set_terminal_window_hook = w32_set_terminal_window; | 6313 | terminal->set_terminal_window_hook = NULL; |
| 6366 | terminal->read_socket_hook = w32_read_socket; | 6314 | terminal->read_socket_hook = w32_read_socket; |
| 6367 | terminal->frame_up_to_date_hook = w32_frame_up_to_date; | 6315 | terminal->frame_up_to_date_hook = w32_frame_up_to_date; |
| 6368 | terminal->mouse_position_hook = w32_mouse_position; | 6316 | terminal->mouse_position_hook = w32_mouse_position; |