Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006281OCamlOCaml otherlibspublic2013-12-28 21:582014-09-15 15:16
Reporterkygron 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSWindowsOS Version
Product Version4.01.0 
Target Versionafter-4.02.1Fixed in Version 
Summary0006281: Graphics window does not acknowledge second click (double click) (fix included)
DescriptionThe Graphics library is configured to ignore a double click event from Windows. For example, clicking 3 times in rapid succession will produce 2 mouse down events, ignoring the one within the double click threshold of the system.

To fix:

win32graph/open.c DoRegisterClass:

wc.style = CS_HREDRAW|CS_VREDRAW |CS_DBLCLKS|CS_OWNDC ;


Remove CS_DBLCLKS from the above style flags and the library will work as intended.

OR

win32graph/events.c caml_gr_handle_event:

  case WM_LBUTTONDOWN:
  case WM_RBUTTONDOWN:
  case WM_MBUTTONDOWN:
->case WM_LBUTTONDBLCLK:
->case WM_RBUTTONDBLCLK:
->case WM_MBUTTONDBLDLK:
  last_button = 1;

add the -> cases to catch the double click events

Steps To Reproducewatch the click count skip doubles in this code fragment:

open Graphics;;
let click_count = ref 0;;
open_graph "";;
while true do
    ignore(wait_next_event [Button_down]);
    click_count := succ !click_count;
    auto_synchronize false;
    clear_graph();
    moveto 0 0;
    draw_string ("Clicks: "^(string_of_int !click_count));
    auto_synchronize true;
done;;
Tagspatch
Attached Files

- Relationships

-  Notes
(0011838)
doligez (administrator)
2014-07-16 11:11

The first solution looks cleaner to me.

- Issue History
Date Modified Username Field Change
2013-12-28 21:58 kygron New Issue
2013-12-30 15:51 doligez Tag Attached: patch
2014-07-16 11:11 doligez Note Added: 0011838
2014-07-16 11:11 doligez Status new => acknowledged
2014-07-16 11:11 doligez Target Version => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-15 15:16 doligez Target Version undecided => after-4.02.1


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker