# HG changeset patch # User Andreas Weber # Date 1417516262 -3600 # Node ID 3492b771c2e6f8448189f28f43e66b4e0ccef508 # Parent 29228fa3edbaf2fc6681693c8e981f9f027238c6 __fltk_ginput__.m: Fix freeze upon double-click (Bug #43664) diff --git a/scripts/plot/util/private/__fltk_ginput__.m b/scripts/plot/util/private/__fltk_ginput__.m --- a/scripts/plot/util/private/__fltk_ginput__.m +++ b/scripts/plot/util/private/__fltk_ginput__.m @@ -47,7 +47,14 @@ sleep (0.01); [x, y, n0, button] = ginput_accumulator (-1, 0, 0, 0); - until (n0 == n || n0 < 0) + until ((n > -1 && n0 >= n) || n0 < 0) + + if (n0 > n) + ## More clicks than requested due to double-click or too fast clicking + x = x(1:n); + y = y(1:n); + button = button(1:n); + endif unwind_protect_cleanup set (f, "windowbuttondownfcn", orig_windowbuttondownfcn);