Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics window does not acknowledge second click (double click) (fix included) #6281

Closed
vicuna opened this issue Dec 28, 2013 · 2 comments
Closed
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Dec 28, 2013

Original bug ID: 6281
Reporter: kygron
Assigned to: @damiendoligez
Status: closed (set by @damiendoligez on 2015-05-12T01:29:16Z)
Resolution: fixed
Priority: normal
Severity: minor
OS: Windows
Version: 4.01.0
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: otherlibs
Tags: patch
Monitored by: @Chris00

Bug description

The 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 reproduce

watch 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;;

@vicuna
Copy link
Author

vicuna commented Jul 16, 2014

Comment author: @damiendoligez

The first solution looks cleaner to me.

@vicuna
Copy link
Author

vicuna commented May 12, 2015

Comment author: @damiendoligez

Fixed in 4.02 branch (rev 16111).

@vicuna vicuna closed this as completed May 12, 2015
@vicuna vicuna added this to the 4.02.2 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants