summaryrefslogtreecommitdiffstats
path: root/maccaml/graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'maccaml/graph.c')
-rw-r--r--maccaml/graph.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/maccaml/graph.c b/maccaml/graph.c
index a23a7bf70..76318bd5b 100644
--- a/maccaml/graph.c
+++ b/maccaml/graph.c
@@ -1109,7 +1109,7 @@ value gr_wait_event (value veventlist)
pt.h = Wx (oldx);
pt.v = Wy (oldy);
LocalToGlobal (&pt);
- /* Restore the grafport now because GetAndProcessEvents may longjmp
+ /* Restore the grafport now because handle_signal may longjmp
directly out of here.
*/
PopPort;
@@ -1118,6 +1118,15 @@ value gr_wait_event (value veventlist)
enter_blocking_section ();
Caml_working (0);
GetAndProcessEvents (askmotion ? waitMove : waitEvent, pt.h, pt.v);
+ if (quit_requested) exit (0);
+ if (intr_requested){
+ intr_requested = 0;
+ Caml_working (1);
+ async_signal_mode = 1;
+ handle_signal (SIGINT);
+ async_signal_mode = 0;
+ Caml_working (0);
+ }
Caml_working (1);
leave_blocking_section ();
if (askkey && (evt = GraphQPop ()) != NULL){
@@ -1156,6 +1165,7 @@ value gr_wait_event (value veventlist)
goto gotevent;
}
}
+ sched_yield ();
}
gotevent:
oldx = mouse_x;