aboutsummaryrefslogtreecommitdiffstats
path: root/src/msdos.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/msdos.c')
-rw-r--r--src/msdos.c65
1 files changed, 19 insertions, 46 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 88a2eb60726..7142c3ada77 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -602,11 +602,7 @@ dos_set_window_size (int *rows, int *cols)
602 Lisp_Object window = hlinfo->mouse_face_window; 602 Lisp_Object window = hlinfo->mouse_face_window;
603 603
604 if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) 604 if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f)
605 { 605 reset_mouse_highlight (hlinfo);
606 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
607 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
608 hlinfo->mouse_face_window = Qnil;
609 }
610 } 606 }
611 607
612 /* Enable bright background colors. */ 608 /* Enable bright background colors. */
@@ -950,9 +946,6 @@ IT_write_glyphs (struct frame *f, struct glyph *str, int str_len)
950 Mouse Highlight (and friends..) 946 Mouse Highlight (and friends..)
951 ************************************************************************/ 947 ************************************************************************/
952 948
953/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
954static Lisp_Object last_mouse_window;
955
956static int mouse_preempted = 0; /* non-zero when XMenu gobbles mouse events */ 949static int mouse_preempted = 0; /* non-zero when XMenu gobbles mouse events */
957 950
958int 951int
@@ -1276,14 +1269,9 @@ IT_update_begin (struct frame *f)
1276 } 1269 }
1277 } 1270 }
1278 else if (mouse_face_frame && !FRAME_LIVE_P (mouse_face_frame)) 1271 else if (mouse_face_frame && !FRAME_LIVE_P (mouse_face_frame))
1279 { 1272 /* If the frame with mouse highlight was deleted, invalidate the
1280 /* If the frame with mouse highlight was deleted, invalidate the 1273 highlight info. */
1281 highlight info. */ 1274 reset_mouse_highlight (hlinfo);
1282 hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1;
1283 hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1;
1284 hlinfo->mouse_face_window = Qnil;
1285 hlinfo->mouse_face_mouse_frame = NULL;
1286 }
1287 1275
1288 unblock_input (); 1276 unblock_input ();
1289} 1277}
@@ -1555,11 +1543,6 @@ IT_reset_terminal_modes (struct terminal *term)
1555 term_setup_done = 0; 1543 term_setup_done = 0;
1556} 1544}
1557 1545
1558static void
1559IT_set_terminal_window (struct frame *f, int foo)
1560{
1561}
1562
1563/* Remember the screen colors of the current frame, to serve as the 1546/* Remember the screen colors of the current frame, to serve as the
1564 default colors for newly-created frames. */ 1547 default colors for newly-created frames. */
1565DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors, 1548DEFUN ("msdos-remember-default-colors", Fmsdos_remember_default_colors,
@@ -1843,17 +1826,8 @@ internal_terminal_init (void)
1843 if (colors[1] >= 0 && colors[1] < 16) 1826 if (colors[1] >= 0 && colors[1] < 16)
1844 FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1]; 1827 FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
1845 } 1828 }
1846 the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL; 1829
1847 the_only_display_info.mouse_highlight.mouse_face_beg_row = 1830 reset_mouse_highlight (&the_only_display_info.mouse_highlight);
1848 the_only_display_info.mouse_highlight.mouse_face_beg_col = -1;
1849 the_only_display_info.mouse_highlight.mouse_face_end_row =
1850 the_only_display_info.mouse_highlight.mouse_face_end_col = -1;
1851 the_only_display_info.mouse_highlight.mouse_face_face_id = DEFAULT_FACE_ID;
1852 the_only_display_info.mouse_highlight.mouse_face_window = Qnil;
1853 the_only_display_info.mouse_highlight.mouse_face_mouse_x =
1854 the_only_display_info.mouse_highlight.mouse_face_mouse_y = 0;
1855 the_only_display_info.mouse_highlight.mouse_face_defer = 0;
1856 the_only_display_info.mouse_highlight.mouse_face_hidden = 0;
1857 1831
1858 if (have_mouse) /* detected in dos_ttraw, which see */ 1832 if (have_mouse) /* detected in dos_ttraw, which see */
1859 { 1833 {
@@ -1889,7 +1863,7 @@ initialize_msdos_display (struct terminal *term)
1889 term->ring_bell_hook = IT_ring_bell; 1863 term->ring_bell_hook = IT_ring_bell;
1890 term->reset_terminal_modes_hook = IT_reset_terminal_modes; 1864 term->reset_terminal_modes_hook = IT_reset_terminal_modes;
1891 term->set_terminal_modes_hook = IT_set_terminal_modes; 1865 term->set_terminal_modes_hook = IT_set_terminal_modes;
1892 term->set_terminal_window_hook = IT_set_terminal_window; 1866 term->set_terminal_window_hook = NULL;
1893 term->update_begin_hook = IT_update_begin; 1867 term->update_begin_hook = IT_update_begin;
1894 term->update_end_hook = IT_update_end; 1868 term->update_end_hook = IT_update_end;
1895 term->frame_up_to_date_hook = IT_frame_up_to_date; 1869 term->frame_up_to_date_hook = IT_frame_up_to_date;
@@ -2691,10 +2665,10 @@ dos_rawgetc (void)
2691 /* Generate SELECT_WINDOW_EVENTs when needed. */ 2665 /* Generate SELECT_WINDOW_EVENTs when needed. */
2692 if (!NILP (Vmouse_autoselect_window)) 2666 if (!NILP (Vmouse_autoselect_window))
2693 { 2667 {
2694 mouse_window = window_from_coordinates (SELECTED_FRAME (), 2668 static Lisp_Object last_mouse_window;
2695 mouse_last_x, 2669
2696 mouse_last_y, 2670 mouse_window = window_from_coordinates
2697 0, 0); 2671 (SELECTED_FRAME (), mouse_last_x, mouse_last_y, 0, 0);
2698 /* A window will be selected only when it is not 2672 /* A window will be selected only when it is not
2699 selected now, and the last mouse movement event was 2673 selected now, and the last mouse movement event was
2700 not in it. A minibuffer window will be selected iff 2674 not in it. A minibuffer window will be selected iff
@@ -2709,10 +2683,9 @@ dos_rawgetc (void)
2709 event.timestamp = event_timestamp (); 2683 event.timestamp = event_timestamp ();
2710 kbd_buffer_store_event (&event); 2684 kbd_buffer_store_event (&event);
2711 } 2685 }
2686 /* Remember the last window where we saw the mouse. */
2712 last_mouse_window = mouse_window; 2687 last_mouse_window = mouse_window;
2713 } 2688 }
2714 else
2715 last_mouse_window = Qnil;
2716 2689
2717 previous_help_echo_string = help_echo_string; 2690 previous_help_echo_string = help_echo_string;
2718 help_echo_string = help_echo_object = help_echo_window = Qnil; 2691 help_echo_string = help_echo_object = help_echo_window = Qnil;
@@ -4073,7 +4046,7 @@ dos_yield_time_slice (void)
4073 because wait_reading_process_output takes care of that. */ 4046 because wait_reading_process_output takes care of that. */
4074int 4047int
4075sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, 4048sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
4076 EMACS_TIME *timeout, void *ignored) 4049 struct timespec *timeout, void *ignored)
4077{ 4050{
4078 int check_input; 4051 int check_input;
4079 struct timespec t; 4052 struct timespec t;
@@ -4103,20 +4076,20 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
4103 } 4076 }
4104 else 4077 else
4105 { 4078 {
4106 EMACS_TIME clnow, cllast, cldiff; 4079 struct timespec clnow, cllast, cldiff;
4107 4080
4108 gettime (&t); 4081 gettime (&t);
4109 cllast = make_emacs_time (t.tv_sec, t.tv_nsec); 4082 cllast = make_timespec (t.tv_sec, t.tv_nsec);
4110 4083
4111 while (!check_input || !detect_input_pending ()) 4084 while (!check_input || !detect_input_pending ())
4112 { 4085 {
4113 gettime (&t); 4086 gettime (&t);
4114 clnow = make_emacs_time (t.tv_sec, t.tv_nsec); 4087 clnow = make_timespec (t.tv_sec, t.tv_nsec);
4115 cldiff = sub_emacs_time (clnow, cllast); 4088 cldiff = timespec_sub (clnow, cllast);
4116 *timeout = sub_emacs_time (*timeout, cldiff); 4089 *timeout = timespec_sub (*timeout, cldiff);
4117 4090
4118 /* Stop when timeout value crosses zero. */ 4091 /* Stop when timeout value crosses zero. */
4119 if (EMACS_TIME_SIGN (*timeout) <= 0) 4092 if (timespec_sign (*timeout) <= 0)
4120 return 0; 4093 return 0;
4121 cllast = clnow; 4094 cllast = clnow;
4122 dos_yield_time_slice (); 4095 dos_yield_time_slice ();