| Anonymous | Login | Signup for a new account | 2013-06-19 20:10 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0004485 | OCaml | OCaml general | public | 2008-01-21 20:32 | 2012-09-15 11:48 | ||||||
| Reporter | sharvil | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||
| Status | confirmed | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.10.1 | ||||||||||
| Target Version | 4.00.2+dev | Fixed in Version | |||||||||
| Summary | 0004485: Keyboard events incorrectly delivered to Graphics module's polling routines when compiled natively | ||||||||||
| Description | Keyboard events and other X events are delivered only after a mouse click in the sample application below. This behaviour is only observed when compiled natively. The issue is related to the delivery of signals. When polling, SIGIO is not delivered in a timely fashion to its handler. Adding the following lines to the start of the function otherlibs/graph/events.c#caml_gr_wait_event_poll fixes the issue by forcing signal delivery. enter_blocking_section(); leave_blocking_section(); | ||||||||||
| Additional Information | Configuration: -------------- OCaml: 3.10.1 (also tested on 3.9.2) OS: Linux 2.6.16 (Debian Etch) CPU: Dual-Core AMD Opteron @ 2.6GHz Command Line: ocamlopt graphics.cmxa test.ml -o test; ./test Steps to reproduce: ------------------- 1) Compile code below using ocamlopt 2) Run application 3) Type string "abc" with "OCaml graphics" window focused 4) Click mouse on "OCaml graphics" window Sample code (test.ml): ---------------------- let main () = Graphics.open_graph " 320x320"; let rec event_loop () = if Graphics.key_pressed () then Printf.printf "Key = %c\n%!" (Graphics.read_key ()) ; if Graphics.button_down () then ( let x, y = Graphics.mouse_pos () in Printf.printf "Mouse at %d,%d\n%!" x y ); event_loop () in event_loop (); Graphics.close_graph () ;; main ();; Expected output: ---------------- Key = a Key = b Key = c Mouse at xxx,yyy Actual output: -------------- Mouse at xxx,yyy Key = a Key = b Key = c | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2008-01-21 20:32 | sharvil | New Issue | |
| 2008-01-22 13:14 | doligez | Status | new => confirmed |
| 2012-07-11 15:59 | doligez | Target Version | => 4.01.0+dev |
| 2012-07-31 13:37 | doligez | Target Version | 4.01.0+dev => 4.00.1+dev |
| 2012-09-15 11:48 | doligez | Target Version | 4.00.1+dev => 4.00.2+dev |
| Copyright © 2000 - 2011 MantisBT Group |