aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w32term.c')
-rw-r--r--src/w32term.c182
1 files changed, 48 insertions, 134 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 59cfdee86b0..532ded7cdad 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -84,9 +84,6 @@ static int last_mousemove_y = 0;
84 84
85static int any_help_event_p; 85static int any_help_event_p;
86 86
87/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
88static Lisp_Object last_window;
89
90extern unsigned int msh_mousewheel; 87extern unsigned int msh_mousewheel;
91 88
92extern void free_frame_menubar (struct frame *); 89extern void free_frame_menubar (struct frame *);
@@ -210,7 +207,6 @@ static int volatile input_signal_count;
210int w32_message_fd = -1; 207int w32_message_fd = -1;
211#endif /* CYGWIN */ 208#endif /* CYGWIN */
212 209
213static void x_update_window_end (struct window *, int, int);
214static void w32_handle_tool_bar_click (struct frame *, 210static void w32_handle_tool_bar_click (struct frame *,
215 struct input_event *); 211 struct input_event *);
216static void w32_define_cursor (Window, Cursor); 212static void w32_define_cursor (Window, Cursor);
@@ -225,8 +221,6 @@ void x_wm_set_icon_pixmap (struct frame *, int);
225static void w32_initialize (void); 221static void w32_initialize (void);
226static void x_update_end (struct frame *); 222static void x_update_end (struct frame *);
227static void w32_frame_up_to_date (struct frame *); 223static void w32_frame_up_to_date (struct frame *);
228static void w32_set_terminal_modes (struct terminal *);
229static void w32_reset_terminal_modes (struct terminal *);
230static void x_clear_frame (struct frame *); 224static void x_clear_frame (struct frame *);
231static void frame_highlight (struct frame *); 225static void frame_highlight (struct frame *);
232static void frame_unhighlight (struct frame *); 226static void frame_unhighlight (struct frame *);
@@ -241,7 +235,8 @@ static void x_frame_rehighlight (struct w32_display_info *);
241static void x_draw_hollow_cursor (struct window *, struct glyph_row *); 235static void x_draw_hollow_cursor (struct window *, struct glyph_row *);
242static void x_draw_bar_cursor (struct window *, struct glyph_row *, int, 236static void x_draw_bar_cursor (struct window *, struct glyph_row *, int,
243 enum text_cursor_kinds); 237 enum text_cursor_kinds);
244static void w32_clip_to_row (struct window *, struct glyph_row *, int, HDC); 238static void w32_clip_to_row (struct window *, struct glyph_row *,
239 enum glyph_row_area, HDC);
245static BOOL my_show_window (struct frame *, HWND, int); 240static BOOL my_show_window (struct frame *, HWND, int);
246static void my_set_window_pos (HWND, HWND, int, int, int, int, UINT); 241static void my_set_window_pos (HWND, HWND, int, int, int, int, UINT);
247#if 0 242#if 0
@@ -577,9 +572,7 @@ x_update_begin (struct frame *f)
577} 572}
578 573
579 574
580/* Start update of window W. Set the global variable updated_window 575/* Start update of window W. */
581 to the window being updated and set output_cursor to the cursor
582 position of W. */
583 576
584static void 577static void
585x_update_window_begin (struct window *w) 578x_update_window_begin (struct window *w)
@@ -593,8 +586,7 @@ x_update_window_begin (struct window *w)
593 SendMessage (w32_system_caret_hwnd, WM_EMACS_HIDE_CARET, 0, 0); 586 SendMessage (w32_system_caret_hwnd, WM_EMACS_HIDE_CARET, 0, 0);
594 } 587 }
595 588
596 updated_window = w; 589 w->output_cursor = w->cursor;
597 set_output_cursor (&w->cursor);
598 590
599 block_input (); 591 block_input ();
600 592
@@ -664,7 +656,7 @@ w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
664} 656}
665 657
666 658
667/* End update of window W (which is equal to updated_window). 659/* End update of window W.
668 660
669 Draw vertical borders between horizontally adjacent windows, and 661 Draw vertical borders between horizontally adjacent windows, and
670 display W's cursor if CURSOR_ON_P is non-zero. 662 display W's cursor if CURSOR_ON_P is non-zero.
@@ -678,19 +670,17 @@ w32_draw_vertical_window_border (struct window *w, int x, int y0, int y1)
678 here. */ 670 here. */
679 671
680static void 672static void
681x_update_window_end (struct window *w, int cursor_on_p, 673x_update_window_end (struct window *w, bool cursor_on_p,
682 int mouse_face_overwritten_p) 674 bool mouse_face_overwritten_p)
683{ 675{
684 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (XFRAME (w->frame));
685
686 if (!w->pseudo_window_p) 676 if (!w->pseudo_window_p)
687 { 677 {
688 block_input (); 678 block_input ();
689 679
690 if (cursor_on_p) 680 if (cursor_on_p)
691 display_and_set_cursor (w, 1, output_cursor.hpos, 681 display_and_set_cursor (w, 1,
692 output_cursor.vpos, 682 w->output_cursor.hpos, w->output_cursor.vpos,
693 output_cursor.x, output_cursor.y); 683 w->output_cursor.x, w->output_cursor.y);
694 684
695 if (draw_window_fringes (w, 1)) 685 if (draw_window_fringes (w, 1))
696 x_draw_vertical_border (w); 686 x_draw_vertical_border (w);
@@ -701,11 +691,7 @@ x_update_window_end (struct window *w, int cursor_on_p,
701 /* If a row with mouse-face was overwritten, arrange for 691 /* If a row with mouse-face was overwritten, arrange for
702 XTframe_up_to_date to redisplay the mouse highlight. */ 692 XTframe_up_to_date to redisplay the mouse highlight. */
703 if (mouse_face_overwritten_p) 693 if (mouse_face_overwritten_p)
704 { 694 reset_mouse_highlight (MOUSE_HL_INFO (XFRAME (w->frame)));
705 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
706 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
707 hlinfo->mouse_face_window = Qnil;
708 }
709 695
710 /* Unhide the caret. This won't actually show the cursor, unless it 696 /* Unhide the caret. This won't actually show the cursor, unless it
711 was visible before the corresponding call to HideCaret in 697 was visible before the corresponding call to HideCaret in
@@ -714,8 +700,6 @@ x_update_window_end (struct window *w, int cursor_on_p,
714 { 700 {
715 SendMessage (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0); 701 SendMessage (w32_system_caret_hwnd, WM_EMACS_SHOW_CARET, 0, 0);
716 } 702 }
717
718 updated_window = NULL;
719} 703}
720 704
721 705
@@ -733,9 +717,8 @@ x_update_end (struct frame *f)
733} 717}
734 718
735 719
736/* This function is called from various places in xdisp.c whenever a 720/* This function is called from various places in xdisp.c
737 complete update has been performed. The global variable 721 whenever a complete update has been performed. */
738 updated_window is not available here. */
739 722
740static void 723static void
741w32_frame_up_to_date (struct frame *f) 724w32_frame_up_to_date (struct frame *f)
@@ -747,15 +730,13 @@ w32_frame_up_to_date (struct frame *f)
747 730
748/* Draw truncation mark bitmaps, continuation mark bitmaps, overlay 731/* Draw truncation mark bitmaps, continuation mark bitmaps, overlay
749 arrow bitmaps, or clear the fringes if no bitmaps are required 732 arrow bitmaps, or clear the fringes if no bitmaps are required
750 before DESIRED_ROW is made current. The window being updated is 733 before DESIRED_ROW is made current. This function is called from
751 found in updated_window. This function is called from
752 update_window_line only if it is known that there are differences 734 update_window_line only if it is known that there are differences
753 between bitmaps to be drawn between current row and DESIRED_ROW. */ 735 between bitmaps to be drawn between current row and DESIRED_ROW. */
754 736
755static void 737static void
756x_after_update_window_line (struct glyph_row *desired_row) 738x_after_update_window_line (struct window *w, struct glyph_row *desired_row)
757{ 739{
758 struct window *w = updated_window;
759 struct frame *f; 740 struct frame *f;
760 int width, height; 741 int width, height;
761 742
@@ -766,7 +747,7 @@ x_after_update_window_line (struct glyph_row *desired_row)
766 747
767 /* When a window has disappeared, make sure that no rest of 748 /* When a window has disappeared, make sure that no rest of
768 full-width rows stays visible in the internal border. Could 749 full-width rows stays visible in the internal border. Could
769 check here if updated_window is the leftmost/rightmost window, 750 check here if updated window is the leftmost/rightmost window,
770 but I guess it's not worth doing since vertically split windows 751 but I guess it's not worth doing since vertically split windows
771 are almost never used, internal border is rarely set, and the 752 are almost never used, internal border is rarely set, and the
772 overhead is very small. */ 753 overhead is very small. */
@@ -863,7 +844,7 @@ w32_draw_fringe_bitmap (struct window *w, struct glyph_row *row,
863 } 844 }
864 845
865 /* Must clip because of partially visible lines. */ 846 /* Must clip because of partially visible lines. */
866 w32_clip_to_row (w, row, -1, hdc); 847 w32_clip_to_row (w, row, ANY_AREA, hdc);
867 848
868 if (p->which && p->which < max_fringe_bmp) 849 if (p->which && p->which < max_fringe_bmp)
869 { 850 {
@@ -948,28 +929,6 @@ w32_destroy_fringe_bitmap (int which)
948 fringe_bmp[which] = 0; 929 fringe_bmp[which] = 0;
949} 930}
950 931
951
952
953/* This is called when starting Emacs and when restarting after
954 suspend. When starting Emacs, no window is mapped. And nothing
955 must be done to Emacs's own window if it is suspended (though that
956 rarely happens). */
957
958static void
959w32_set_terminal_modes (struct terminal *term)
960{
961}
962
963/* This is called when exiting or suspending Emacs. Exiting will make
964 the W32 windows go away, and suspending requires no action. */
965
966static void
967w32_reset_terminal_modes (struct terminal *term)
968{
969}
970
971
972
973/*********************************************************************** 932/***********************************************************************
974 Display Iterator 933 Display Iterator
975 ***********************************************************************/ 934 ***********************************************************************/
@@ -2665,11 +2624,7 @@ x_clear_frame (struct frame *f)
2665 /* 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
2666 longer visible. */ 2625 longer visible. */
2667 mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f))); 2626 mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
2668 output_cursor.hpos = output_cursor.vpos = 0;
2669 output_cursor.x = -1;
2670 2627
2671 /* We don't set the output cursor here because there will always
2672 follow an explicit cursor_to. */
2673 block_input (); 2628 block_input ();
2674 2629
2675 w32_clear_window (f); 2630 w32_clear_window (f);
@@ -2707,19 +2662,6 @@ w32_ring_bell (struct frame *f)
2707 unblock_input (); 2662 unblock_input ();
2708} 2663}
2709 2664
2710
2711/* Specify how many text lines, from the top of the window,
2712 should be affected by insert-lines and delete-lines operations.
2713 This, and those operations, are used only within an update
2714 that is bounded by calls to x_update_begin and x_update_end. */
2715
2716static void
2717w32_set_terminal_window (struct frame *f, int n)
2718{
2719 /* This function intentionally left blank. */
2720}
2721
2722
2723/*********************************************************************** 2665/***********************************************************************
2724 Line Dance 2666 Line Dance
2725 ***********************************************************************/ 2667 ***********************************************************************/
@@ -2750,7 +2692,7 @@ x_scroll_run (struct window *w, struct run *run)
2750 /* 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,
2751 without mode lines. Include in this box the left and right 2693 without mode lines. Include in this box the left and right
2752 fringes of W. */ 2694 fringes of W. */
2753 window_box (w, -1, &x, &y, &width, &height); 2695 window_box (w, ANY_AREA, &x, &y, &width, &height);
2754 2696
2755 /* 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
2756 leftmost (rightmost, respectively) window, then extend its 2698 leftmost (rightmost, respectively) window, then extend its
@@ -2806,7 +2748,6 @@ x_scroll_run (struct window *w, struct run *run)
2806 block_input (); 2748 block_input ();
2807 2749
2808 /* Cursor off. Will be switched on again in x_update_window_end. */ 2750 /* Cursor off. Will be switched on again in x_update_window_end. */
2809 updated_window = w;
2810 x_clear_cursor (w); 2751 x_clear_cursor (w);
2811 2752
2812 { 2753 {
@@ -3765,7 +3706,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
3765 HWND hwnd; 3706 HWND hwnd;
3766 SCROLLINFO si; 3707 SCROLLINFO si;
3767 struct scroll_bar *bar 3708 struct scroll_bar *bar
3768 = XSCROLL_BAR (Fmake_vector (make_number (VECSIZE (struct scroll_bar)), Qnil)); 3709 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, fringe_extended_p, PVEC_OTHER);
3769 Lisp_Object barobj; 3710 Lisp_Object barobj;
3770 3711
3771 block_input (); 3712 block_input ();
@@ -3778,7 +3719,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
3778 XSETINT (bar->start, 0); 3719 XSETINT (bar->start, 0);
3779 XSETINT (bar->end, 0); 3720 XSETINT (bar->end, 0);
3780 bar->dragging = Qnil; 3721 bar->dragging = Qnil;
3781 bar->fringe_extended_p = Qnil; 3722 bar->fringe_extended_p = 0;
3782 3723
3783 /* Requires geometry to be set before call to create the real window */ 3724 /* Requires geometry to be set before call to create the real window */
3784 3725
@@ -3842,10 +3783,10 @@ w32_set_vertical_scroll_bar (struct window *w,
3842 struct scroll_bar *bar; 3783 struct scroll_bar *bar;
3843 int top, height, left, sb_left, width, sb_width; 3784 int top, height, left, sb_left, width, sb_width;
3844 int window_y, window_height; 3785 int window_y, window_height;
3845 int fringe_extended_p; 3786 bool fringe_extended_p;
3846 3787
3847 /* Get window dimensions. */ 3788 /* Get window dimensions. */
3848 window_box (w, -1, 0, &window_y, 0, &window_height); 3789 window_box (w, ANY_AREA, 0, &window_y, 0, &window_height);
3849 top = window_y; 3790 top = window_y;
3850 width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f); 3791 width = WINDOW_CONFIG_SCROLL_BAR_COLS (w) * FRAME_COLUMN_WIDTH (f);
3851 height = window_height; 3792 height = window_height;
@@ -3866,16 +3807,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3866 else 3807 else
3867 sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width); 3808 sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
3868 3809
3869 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w)) 3810 fringe_extended_p = WINDOW_FRINGE_EXTENDED_P (w);
3870 fringe_extended_p = (WINDOW_LEFTMOST_P (w)
3871 && WINDOW_LEFT_FRINGE_WIDTH (w)
3872 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
3873 || WINDOW_LEFT_MARGIN_COLS (w) == 0));
3874 else
3875 fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
3876 && WINDOW_RIGHT_FRINGE_WIDTH (w)
3877 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
3878 || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
3879 3811
3880 /* Does the scroll bar exist yet? */ 3812 /* Does the scroll bar exist yet? */
3881 if (NILP (w->vertical_scroll_bar)) 3813 if (NILP (w->vertical_scroll_bar))
@@ -3904,11 +3836,11 @@ w32_set_vertical_scroll_bar (struct window *w,
3904 hwnd = SCROLL_BAR_W32_WINDOW (bar); 3836 hwnd = SCROLL_BAR_W32_WINDOW (bar);
3905 3837
3906 /* If already correctly positioned, do nothing. */ 3838 /* If already correctly positioned, do nothing. */
3907 if ( XINT (bar->left) == sb_left 3839 if (XINT (bar->left) == sb_left
3908 && XINT (bar->top) == top 3840 && XINT (bar->top) == top
3909 && XINT (bar->width) == sb_width 3841 && XINT (bar->width) == sb_width
3910 && XINT (bar->height) == height 3842 && XINT (bar->height) == height
3911 && !NILP (bar->fringe_extended_p) == fringe_extended_p ) 3843 && bar->fringe_extended_p == fringe_extended_p)
3912 { 3844 {
3913 /* Redraw after clear_frame. */ 3845 /* Redraw after clear_frame. */
3914 if (!my_show_window (f, hwnd, SW_NORMAL)) 3846 if (!my_show_window (f, hwnd, SW_NORMAL))
@@ -3958,7 +3890,7 @@ w32_set_vertical_scroll_bar (struct window *w,
3958 unblock_input (); 3890 unblock_input ();
3959 } 3891 }
3960 } 3892 }
3961 bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; 3893 bar->fringe_extended_p = fringe_extended_p;
3962 3894
3963 w32_set_scroll_bar_thumb (bar, portion, position, whole); 3895 w32_set_scroll_bar_thumb (bar, portion, position, whole);
3964 XSETVECTOR (barobj, bar); 3896 XSETVECTOR (barobj, bar);
@@ -4568,18 +4500,16 @@ w32_read_socket (struct terminal *terminal,
4568 /* Generate SELECT_WINDOW_EVENTs when needed. */ 4500 /* Generate SELECT_WINDOW_EVENTs when needed. */
4569 if (!NILP (Vmouse_autoselect_window)) 4501 if (!NILP (Vmouse_autoselect_window))
4570 { 4502 {
4571 Lisp_Object window; 4503 static Lisp_Object last_mouse_window;
4572 int x = LOWORD (msg.msg.lParam); 4504 Lisp_Object window = window_from_coordinates
4573 int y = HIWORD (msg.msg.lParam); 4505 (f, LOWORD (msg.msg.lParam), HIWORD (msg.msg.lParam), 0, 0);
4574
4575 window = window_from_coordinates (f, x, y, 0, 0);
4576 4506
4577 /* Window will be selected only when it is not 4507 /* Window will be selected only when it is not
4578 selected now and last mouse movement event was 4508 selected now and last mouse movement event was
4579 not in it. Minibuffer window will be selected 4509 not in it. Minibuffer window will be selected
4580 only when it is active. */ 4510 only when it is active. */
4581 if (WINDOWP (window) 4511 if (WINDOWP (window)
4582 && !EQ (window, last_window) 4512 && !EQ (window, last_mouse_window)
4583 && !EQ (window, selected_window) 4513 && !EQ (window, selected_window)
4584 /* For click-to-focus window managers 4514 /* For click-to-focus window managers
4585 create event iff we don't leave the 4515 create event iff we don't leave the
@@ -4591,8 +4521,8 @@ w32_read_socket (struct terminal *terminal,
4591 inev.kind = SELECT_WINDOW_EVENT; 4521 inev.kind = SELECT_WINDOW_EVENT;
4592 inev.frame_or_window = window; 4522 inev.frame_or_window = window;
4593 } 4523 }
4594 4524 /* Remember the last window where we saw the mouse. */
4595 last_window = window; 4525 last_mouse_window = window;
4596 } 4526 }
4597 if (!note_mouse_movement (f, &msg.msg)) 4527 if (!note_mouse_movement (f, &msg.msg))
4598 help_echo_string = previous_help_echo_string; 4528 help_echo_string = previous_help_echo_string;
@@ -5147,7 +5077,8 @@ w32_read_socket (struct terminal *terminal,
5147 mode lines must be clipped to the whole window. */ 5077 mode lines must be clipped to the whole window. */
5148 5078
5149static void 5079static void
5150w32_clip_to_row (struct window *w, struct glyph_row *row, int area, HDC hdc) 5080w32_clip_to_row (struct window *w, struct glyph_row *row,
5081 enum glyph_row_area area, HDC hdc)
5151{ 5082{
5152 RECT clip_rect; 5083 RECT clip_rect;
5153 int window_x, window_y, window_width; 5084 int window_x, window_y, window_width;
@@ -5317,8 +5248,8 @@ w32_clear_frame_area (struct frame *f, int x, int y, int width, int height)
5317 5248
5318static void 5249static void
5319w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, 5250w32_draw_window_cursor (struct window *w, struct glyph_row *glyph_row,
5320 int x, int y, int cursor_type, int cursor_width, 5251 int x, int y, enum text_cursor_kinds cursor_type,
5321 int on_p, int active_p) 5252 int cursor_width, bool on_p, bool active_p)
5322{ 5253{
5323 if (on_p) 5254 if (on_p)
5324 { 5255 {
@@ -5717,7 +5648,9 @@ w32fullscreen_hook (struct frame *f)
5717 w32_fullscreen_rect (hwnd, f->want_fullscreen, 5648 w32_fullscreen_rect (hwnd, f->want_fullscreen,
5718 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect); 5649 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect);
5719 FRAME_PREV_FSMODE (f) = f->want_fullscreen; 5650 FRAME_PREV_FSMODE (f) = f->want_fullscreen;
5720 if (f->want_fullscreen == FULLSCREEN_BOTH) 5651 if (f->want_fullscreen == FULLSCREEN_MAXIMIZED)
5652 PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, 0xf030, 0);
5653 else if (f->want_fullscreen == FULLSCREEN_BOTH)
5721 { 5654 {
5722 SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); 5655 SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
5723 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, 5656 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top,
@@ -6172,16 +6105,8 @@ x_free_frame_resources (struct frame *f)
6172 dpyinfo->w32_focus_event_frame = 0; 6105 dpyinfo->w32_focus_event_frame = 0;
6173 if (f == dpyinfo->x_highlight_frame) 6106 if (f == dpyinfo->x_highlight_frame)
6174 dpyinfo->x_highlight_frame = 0; 6107 dpyinfo->x_highlight_frame = 0;
6175
6176 if (f == hlinfo->mouse_face_mouse_frame) 6108 if (f == hlinfo->mouse_face_mouse_frame)
6177 { 6109 reset_mouse_highlight (hlinfo);
6178 hlinfo->mouse_face_beg_row
6179 = hlinfo->mouse_face_beg_col = -1;
6180 hlinfo->mouse_face_end_row
6181 = hlinfo->mouse_face_end_col = -1;
6182 hlinfo->mouse_face_window = Qnil;
6183 hlinfo->mouse_face_mouse_frame = 0;
6184 }
6185 6110
6186 unblock_input (); 6111 unblock_input ();
6187} 6112}
@@ -6251,7 +6176,6 @@ void
6251w32_initialize_display_info (Lisp_Object display_name) 6176w32_initialize_display_info (Lisp_Object display_name)
6252{ 6177{
6253 struct w32_display_info *dpyinfo = &one_w32_display_info; 6178 struct w32_display_info *dpyinfo = &one_w32_display_info;
6254 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
6255 6179
6256 memset (dpyinfo, 0, sizeof (*dpyinfo)); 6180 memset (dpyinfo, 0, sizeof (*dpyinfo));
6257 6181
@@ -6274,17 +6198,10 @@ w32_initialize_display_info (Lisp_Object display_name)
6274 dpyinfo->n_fonts = 0; 6198 dpyinfo->n_fonts = 0;
6275 dpyinfo->smallest_font_height = 1; 6199 dpyinfo->smallest_font_height = 1;
6276 dpyinfo->smallest_char_width = 1; 6200 dpyinfo->smallest_char_width = 1;
6277
6278 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
6279 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
6280 hlinfo->mouse_face_face_id = DEFAULT_FACE_ID;
6281 hlinfo->mouse_face_window = Qnil;
6282 hlinfo->mouse_face_overlay = Qnil;
6283 hlinfo->mouse_face_hidden = 0;
6284
6285 dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW); 6201 dpyinfo->vertical_scroll_bar_cursor = w32_load_cursor (IDC_ARROW);
6286 /* TODO: dpyinfo->gray */ 6202 /* TODO: dpyinfo->gray */
6287 6203
6204 reset_mouse_highlight (&dpyinfo->mouse_highlight);
6288} 6205}
6289 6206
6290/* Create an xrdb-style database of resources to supersede registry settings. 6207/* Create an xrdb-style database of resources to supersede registry settings.
@@ -6359,7 +6276,6 @@ static struct redisplay_interface w32_redisplay_interface =
6359 x_after_update_window_line, 6276 x_after_update_window_line,
6360 x_update_window_begin, 6277 x_update_window_begin,
6361 x_update_window_end, 6278 x_update_window_end,
6362 x_cursor_to,
6363 x_flush, 6279 x_flush,
6364 0, /* flush_display_optional */ 6280 0, /* flush_display_optional */
6365 x_clear_window_mouse_face, 6281 x_clear_window_mouse_face,
@@ -6396,11 +6312,11 @@ w32_create_terminal (struct w32_display_info *dpyinfo)
6396 terminal->ins_del_lines_hook = x_ins_del_lines; 6312 terminal->ins_del_lines_hook = x_ins_del_lines;
6397 terminal->delete_glyphs_hook = x_delete_glyphs; 6313 terminal->delete_glyphs_hook = x_delete_glyphs;
6398 terminal->ring_bell_hook = w32_ring_bell; 6314 terminal->ring_bell_hook = w32_ring_bell;
6399 terminal->reset_terminal_modes_hook = w32_reset_terminal_modes; 6315 terminal->reset_terminal_modes_hook = NULL;
6400 terminal->set_terminal_modes_hook = w32_set_terminal_modes; 6316 terminal->set_terminal_modes_hook = NULL;
6401 terminal->update_begin_hook = x_update_begin; 6317 terminal->update_begin_hook = x_update_begin;
6402 terminal->update_end_hook = x_update_end; 6318 terminal->update_end_hook = x_update_end;
6403 terminal->set_terminal_window_hook = w32_set_terminal_window; 6319 terminal->set_terminal_window_hook = NULL;
6404 terminal->read_socket_hook = w32_read_socket; 6320 terminal->read_socket_hook = w32_read_socket;
6405 terminal->frame_up_to_date_hook = w32_frame_up_to_date; 6321 terminal->frame_up_to_date_hook = w32_frame_up_to_date;
6406 terminal->mouse_position_hook = w32_mouse_position; 6322 terminal->mouse_position_hook = w32_mouse_position;
@@ -6478,9 +6394,7 @@ w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
6478 terminal = w32_create_terminal (dpyinfo); 6394 terminal = w32_create_terminal (dpyinfo);
6479 6395
6480 /* Set the name of the terminal. */ 6396 /* Set the name of the terminal. */
6481 terminal->name = xmalloc (SBYTES (display_name) + 1); 6397 terminal->name = xlispstrdup (display_name);
6482 strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
6483 terminal->name[SBYTES (display_name)] = 0;
6484 6398
6485 dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL; 6399 dpyinfo->xrdb = xrm_option ? w32_make_rdb (xrm_option) : NULL;
6486 6400