comparison src/ChangeLog @ 1268:fffe735e63ee

[xemacs-hg @ 2003-02-07 11:50:50 by ben] fixes for menu crashes + better preemption behavior This contains two related changes: (1) Fix problems with reentrant calling of lwlib and associated crashes when selecting menu items. (2) Improve redisplay handling of preemption. Turn on lazy lock and hold down page-down or page-up and you'll see what I mean. They are related because they both touch on the code that retrieves events and handles the internal queues. console-msw.h, event-msw.c, event-stream.c, events.h, menubar-msw.c, menubar-x.c, menubar.h: mswindows_protect_modal_loop() has been generalized to event_stream_protect_modal_loop(), and moved to event-stream.c. mswindows_in_modal_loop ->in_modal_loop likewise. Changes in event-msw.c and menubar-msw.c for the new names and calling format (use structures instead of static variables in menubar-msw.c). Delete former in_menu_callback and use in_modal_loop in its place. Remove emacs_mswindows_quit_check_disallowed_p(), superseded by in_modal_loop. Use event_stream_protect_modal_loop() in pre_activate_callback() so that we get no lwlib reentrancy. Rearrange some of the code in event-msw.c to be grouped better. Make mswindows_drain_windows_queue() respect in_modal_loop and do nothing if so. cmdloop.c, event-stream.c: Don't conditionalize on LWLIB_MENUBARS_LUCID when giving error when in_modal_loop, and give better error. event-Xt.c, event-gtk.c: If in_modal_loop, only retrieve process and timeout events. Don't retrieve any X events because processing them can lead to reentrancy in lwlib -> death. event-stream.c: Remove unused parameter to check_event_stream_ok() and change all callers. lisp.h, event-stream.c: Rearrange some functions for increased clarity -- in particular, group all the input-pending/QUIT-related stuff together, and put right next to next-event stuff, to which it's related. Add the concept of "HOW_MANY" -- when asking whether user input is pending, you can ask if at least HOW_MANY events are pending, not just if any are. Add parameter to detect_input_pending() for this. Change recursive_sit_for from a Lisp_Object (which could only be Qt or Qnil) to an int, like it should be. event-Xt.c, event-gtk.c, event-xlike-inc.c: New file. Abstract out similar code in event_{Xt/gtk}_pending_p() and write only once, using include-file tricks. Rewrite this function to implement HOW_MANY and only process events when not in_modal_loop. event-msw.c: Implement HOW_MANY and only process events when not in_modal_loop. event-tty.c: Implement HOW_MANY. redisplay.c: Add var `max-preempts' to control maximum number of preempts. (#### perhaps not useful) Rewrite preemption check so that, rather than preempting when any user events are available, only preempt when a certain number (currently 4) of them are backed up. This effectively allows redisplay to proceed to completion in the presence of a fast auto-repeat (usually the auto-repeating is generated dynamically as necessary), and you get much better display behavior with lazy-lock active. event-unixoid.c: Comment changes. event-stream.c: Rewrite discard-input much more simply and safely using the drain-queue functions. I think the old version might loop forever if called when in_modal_loop. SEMI-UNRELATED CHANGES: ----------------------- event-stream.c: Turn QUIT-checking back on when running the pre-idle hook so it can be quit out of. indent.c: Document exact functioning of `vertical-motion' better, and its differences from GNU Emacs.
author ben
date Fri, 07 Feb 2003 11:50:54 +0000
parents c57f32e44416
children 44186d7cf4dd
comparison
equal deleted inserted replaced
1267:c57f32e44416 1268:fffe735e63ee
1 2003-02-07 Ben Wing <ben@xemacs.org>
2
3 This contains two related changes:
4
5 (1) Fix problems with reentrant calling of lwlib and associated
6 crashes when selecting menu items.
7 (2) Improve redisplay handling of preemption. Turn on lazy lock
8 and hold down page-down or page-up and you'll see what I mean.
9
10 They are related because they both touch on the code that retrieves
11 events and handles the internal queues.
12
13 * console-msw.h:
14 * event-msw.c:
15 * event-msw.c (mswindows_unmodalize_signal_maybe):
16 * event-msw.c (mswindows_unsafe_pump_events):
17 * event-msw.c (mswindows_pump_outstanding_events):
18 * event-msw.c (mswindows_need_event_in_modal_loop):
19 * event-msw.c (mswindows_drain_windows_queue):
20 * event-msw.c (mswindows_need_event):
21 * event-msw.c (reinit_vars_of_event_mswindows):
22 * event-stream.c (event_stream_protect_modal_loop):
23 * events.h:
24 * events.h (struct event_stream):
25 * menubar-msw.c (struct handle_wm_initmenu):
26 * menubar-msw.c (unsafe_handle_wm_initmenupopup):
27 * menubar-msw.c (unsafe_handle_wm_initmenu):
28 * menubar-msw.c (mswindows_handle_wm_initmenupopup):
29 * menubar-msw.c (mswindows_handle_wm_initmenu):
30 * menubar-x.c:
31 * menubar-x.c (protected_menu_item_descriptor_to_widget_value):
32 * menubar-x.c (pre_activate_callback):
33 * menubar.h:
34
35 mswindows_protect_modal_loop() has been generalized to
36 event_stream_protect_modal_loop(), and moved to event-stream.c.
37 mswindows_in_modal_loop ->in_modal_loop likewise. Changes in
38 event-msw.c and menubar-msw.c for the new names and calling format
39 (use structures instead of static variables in menubar-msw.c).
40 Delete former in_menu_callback and use in_modal_loop in its place.
41 Remove emacs_mswindows_quit_check_disallowed_p(), superseded by
42 in_modal_loop. Use event_stream_protect_modal_loop() in
43 pre_activate_callback() so that we get no lwlib reentrancy.
44
45 Rearrange some of the code in event-msw.c to be grouped better.
46 Make mswindows_drain_windows_queue() respect in_modal_loop and
47 do nothing if so.
48
49 * cmdloop.c (command_loop_3):
50 * event-stream.c (Fnext_event):
51 Don't conditionalize on LWLIB_MENUBARS_LUCID when giving error when
52 in_modal_loop, and give better error.
53
54 * event-Xt.c (emacs_Xt_next_event):
55 * event-Xt.c (emacs_Xt_drain_queue):
56 * event-gtk.c (emacs_gtk_drain_queue):
57 If in_modal_loop, only retrieve process and timeout events.
58 Don't retrieve any X events because processing them can lead
59 to reentrancy in lwlib -> death.
60
61 * event-stream.c:
62 * event-stream.c (check_event_stream_ok):
63 * event-stream.c (event_stream_handle_magic_event):
64 * event-stream.c (event_stream_format_magic_event):
65 * event-stream.c (event_stream_compare_magic_event):
66 * event-stream.c (event_stream_hash_magic_event):
67 * event-stream.c (event_stream_add_timeout):
68 * event-stream.c (event_stream_remove_timeout):
69 * event-stream.c (event_stream_select_console):
70 * event-stream.c (event_stream_unselect_console):
71 * event-stream.c (event_stream_select_process):
72 * event-stream.c (event_stream_unselect_process):
73 * event-stream.c (event_stream_create_io_streams):
74 * event-stream.c (event_stream_delete_io_streams):
75 * event-stream.c (event_stream_current_event_timestamp):
76 * event-stream.c (event_stream_next_event):
77 Remove unused parameter to check_event_stream_ok() and change
78 all callers.
79
80 * lisp.h:
81 * event-stream.c (maybe_do_auto_save):
82 * event-stream.c (emacs_handle_focus_change_preliminary):
83 * event-stream.c (emacs_handle_focus_change_final):
84 * event-stream.c (detect_input_pending):
85 * event-stream.c (maybe_read_quit_event):
86 * event-stream.c (remove_quit_p_event):
87 * event-stream.c (event_stream_quit_p):
88 * event-stream.c (event_stream_next_event):
89 * event-stream.c (sit_for_unwind):
90 * event-stream.c (Faccept_process_output):
91 * event-stream.c (Fsleep_for):
92 * event-stream.c (Fsit_for):
93 * event-stream.c (maybe_kbd_translate):
94 * event-stream.c (command_builder_find_leaf_no_mule_processing):
95 * event-stream.c (reinit_vars_of_event_stream):
96 Rearrange some functions for increased clarity -- in particular,
97 group all the input-pending/QUIT-related stuff together, and
98 put right next to next-event stuff, to which it's related.
99 Add the concept of "HOW_MANY" -- when asking whether user input
100 is pending, you can ask if at least HOW_MANY events are pending,
101 not just if any are. Add parameter to detect_input_pending()
102 for this. Change recursive_sit_for from a Lisp_Object (which
103 could only be Qt or Qnil) to an int, like it should be.
104
105 * event-Xt.c:
106 * event-Xt.c (THIS_IS_X):
107 * event-gtk.c:
108 * event-gtk.c (THIS_IS_GTK):
109 * event-xlike-inc.c: New file.
110 Abstract out similar code in event_{Xt/gtk}_pending_p() and write
111 only once, using include-file tricks. Rewrite this function to
112 implement HOW_MANY and only process events when not in_modal_loop.
113
114 * event-msw.c (emacs_mswindows_event_pending_p):
115 Implement HOW_MANY and only process events when not in_modal_loop.
116
117 * event-tty.c:
118 * event-tty.c (tty_timeout_to_emacs_event):
119 * event-tty.c (emacs_tty_event_pending_p):
120 Implement HOW_MANY.
121
122 * redisplay.c:
123 * redisplay.c (QUEUED_EVENTS_REQUIRED_FOR_PREEMPTION):
124 * redisplay.c (init_redisplay):
125 * redisplay.c (vars_of_redisplay):
126 Add var `max-preempts' to control maximum number of preempts.
127 (#### perhaps not useful) Rewrite preemption check so that,
128 rather than preempting when any user events are available, only
129 preempt when a certain number (currently 4) of them are backed up.
130 This effectively allows redisplay to proceed to completion in the
131 presence of a fast auto-repeat (usually the auto-repeating is
132 generated dynamically as necessary), and you get much better
133 display behavior with lazy-lock active.
134
135 * event-unixoid.c:
136 Comment changes.
137
138 * event-stream.c (command_event_p_cb):
139 * event-stream.c (Fdiscard_input):
140 Rewrite discard-input much more simply and safely using the
141 drain-queue functions. I think the old version might loop
142 forever if called when in_modal_loop.
143
144 SEMI-UNRELATED CHANGES:
145 -----------------------
146
147 * event-stream.c (run_pre_idle_hook):
148 Turn QUIT-checking back on when running the pre-idle hook so it
149 can be quit out of.
150
151 * indent.c:
152 Document exact functioning of `vertical-motion' better, and its
153 differences from GNU Emacs.
154
155
1 2003-02-06 Ben Wing <ben@xemacs.org> 156 2003-02-06 Ben Wing <ben@xemacs.org>
2 157
3 * unicode.c: 158 * unicode.c:
4 * unicode.c (struct utf_16_detector): 159 * unicode.c (struct utf_16_detector):
5 * unicode.c (utf_16_detect): 160 * unicode.c (utf_16_detect):