bugGNU Octave - Bugs: bug #43664, ginput() freezes upon...

 
 

bug #43664: ginput() freezes upon double-clicking in a fltk figure

Submitted by:  None
Submitted on:  Fri 21 Nov 2014 04:04:15 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedAssigned to: None
Originator Name: AdrianOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.2
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 02 Dec 2014 10:34:01 AM UTC, comment #5:

Fixed with cset 3492b771c2e6 (http://hg.savannah.gnu.org/hgweb/octave/rev/3492b771c2e6)

A friend tried the behavior in Matlab and they also count double-clicks as two separate clicks.

Closing bugreport as fixed.

Andreas Weber <andy1978>
Project Member
Sun 23 Nov 2014 11:56:06 AM UTC, comment #4:

On the default branch you could check the figure property "selectiontype" which is "open" for double-click events. (implemented with cset 7f73293d8423)

Unfortunally you have to wait for the 4.2 release until this gets stable.

Andreas Weber <andy1978>
Project Member
Sat 22 Nov 2014 11:40:26 AM UTC, comment #3:

Thanks a lot, the patch squashes the bug indeed.

Note however that it now becomes quite impossible to distinguish a simple from a double-click, and that information is lost. I'd advocate keeping only the first line of your patch, and explicitly say in the function doc that the returned array may contain more entries than requested, in case of very fast clicks (e.g. double-clicks).

Another solution would be to have ginput remember the additional click for the next call on the same window. This is not very satisfying though, because it is still impossible for a script to find out whether a double-click happened: it would require a non-blocking or timed-out second call to ginput(1), which does not exist.

I'll try to find out how Matlab behaves in this regard.

Adrian <adaerr>
Fri 21 Nov 2014 05:25:32 PM UTC, comment #2:

Patch attached, can this go to stable or should this go to default?
I think it would be also interesting how Matlab behaves on double-click.

(file #32518)

Andreas Weber <andy1978>
Project Member
Fri 21 Nov 2014 04:48:03 PM UTC, comment #1:

I can confirm this with 3.8.2 and on the default branch (although it's much harder to reproduuce on default).

The reason on stable is, that in _fttk_ginput_.m, line 51

waits until n0 matches exactly the number of requested clicks but if the user is very fast and double clicks, n0 get 2 and the loop doesn't get aborted. A solution would be to change this to

and remove the surplus entries in x,y and button. Can someone test how Matlab behaves on double clicks in ginput?

Andreas Weber <andy1978>
Project Member
Fri 21 Nov 2014 04:04:15 PM UTC, original submission:

On my computer the bug can be reliably reproduced by the following few instructions in a fresh interactive session:

# display a large image, then invoque ginput:
a=0:2000;
imagesc(a'*a)
ginput(1)

and then double-clicking inside the Figure window. Normally (such as for a normal plot() window or if I replace 2000 by a small number such as 20 in the instructions above) the function ginput(1) will return upon the double-click. In the above example however the function does not return, and appears to have frozen: it does not return even upon subsequent clicks (simple left or right click) into the Figure window. The function has to be interrupted by pressing Ctrl-C.

The expected behaviour would at least be not to freeze, and either return immediately or on the next click.
Because double-clicking in a fltk Figure window has a special effect (causing an autoscale), I feel that ginput() should not react at all to it (lest there be a way to tell the double-click from a simple click, so we know what is a mere change of the zoom level and what is real input). But that's another debate, the bug report here is about the freezing.

System details:
GNU/Linux Debian mixed stable/testing
octave is configured to use fltk as graphics_toolkit
(using graphics_toolkit("gnuplot") the bug disappears, that is ginput(1) returns upon double-click, but here the double-click also does not have the special effect of causing an autoscale as in the fltk window)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32518:  bug_43664_ginput.diff added by andy1978 (671B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by adaerr (Posted a comment)
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Dec 2014 10:34:01 AM UTCandy1978StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Fri 21 Nov 2014 05:25:32 PM UTCandy1978Attached File-=>Added bug_43664_ginput.diff, #32518
      StatusConfirmed=>Patch Submitted
    Fri 21 Nov 2014 04:48:03 PM UTCandy1978StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1