bugGNU Octave - Bugs: bug #56857, ButtonDownFcn and KeyPressFcn...

 
 

bug #56857: ButtonDownFcn and KeyPressFcn callbacks not executing

Submitter:  Guillaume <gyom>
Submitted:  Wed 04 Sep 2019 10:17:57 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 17 Sep 2019 06:40:24 PM UTC, comment #8: 

I removed the duplicate connection in this changeset:
http://hg.savannah.gnu.org/hgweb/octave/rev/c40be2cf044d

Markus Mützel <mmuetzel>
Group administrator
Fri 13 Sep 2019 12:20:54 PM UTC, comment #7: 

Yes, it's a copy/paste of a copy/paste error.

Pantxo Diribarne <pantxo>
Group Member
Fri 13 Sep 2019 12:14:49 PM UTC, comment #6: 

I'm not an expert in this signal-slot-mechanics. But the following lines seem to occur twice in Object.cc (Object::do_connections):

+    connect (emitter,
+             SIGNAL (interpreter_event (const octave::meth_callback&)),
+             receiver,
+             SLOT (interpreter_event (const octave::meth_callback&)));
+
+    connect (emitter,
+             SIGNAL (interpreter_event (const octave::meth_callback&)),
+             receiver,
+             SLOT (interpreter_event (const octave::meth_callback&)));


Is this a copy and paste error?

Markus Mützel <mmuetzel>
Group administrator
Fri 06 Sep 2019 03:55:11 PM UTC, comment #5: 

Thanks. I pushed the patch here:

http://hg.savannah.gnu.org/hgweb/octave/rev/1952e110d346

Closing report as fixed.

Pantxo Diribarne <pantxo>
Group Member
Fri 06 Sep 2019 10:04:10 AM UTC, comment #4: 

Sorry for the misleading comment about waitfor - this issue occurred within a larger context and I got confused.
I tried the patch from comment #3 and everything seems back to normal, thanks Pantxo!

Guillaume <gyom>
Thu 05 Sep 2019 08:22:48 AM UTC, comment #3: 

(Pantxo)
I attached a patch that fixes the issue for me.

(file #47457)

Anonymous
Wed 04 Sep 2019 08:25:24 PM UTC, comment #2: 

I think the issue is that we emit signals from the Canvas Object that are not connected to any slot. IIUC we currently only make the necessary connections for top level Object (which have their graphics_object counterpart) after their creation in qt_graphics_toolkit::create_object. Ccing jwe who made the relevant changes:


changeset:   27319:6b2d20317b26
user:        John W. Eaton <jwe@octave.org>
date:        Fri Aug 02 15:19:43 2019 -0500
summary:     use Qt signals to manage calls to gh_manager functions in Qt graphics toolkit


Pantxo Diribarne <pantxo>
Group Member
Wed 04 Sep 2019 07:42:32 PM UTC, comment #1: 

The waitfor is irrelevant to this working or not for me. I confirm that nothing happens when a ButtonDownFcn is set on the image object, the axes object, or the figure object, or if a KeyPressFcn is set on the figure object.

Mike Miller <mtmiller>
Group Member
Wed 04 Sep 2019 10:17:57 AM UTC, original submission:  

With the following code, the callback is executed when clicking on the image in Octave 5.1 but not any more with dev:


h = figure;
imagesc (rand (64), "ButtonDownFcn", @(varargin) disp("clic"));
drawnow
waitfor (h);


Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #47457:  object_connections.patch added by None (11KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by pantxo
  • -email is unavailable- added by gyom (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-06 pantxo StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2019-09-05 None Attached File- Added object_connections.patch, #47457
    2019-09-04 pantxo Carbon-Copy- Added jwe
    2019-09-04 mtmiller StatusNone Confirmed
        SummaryCallbacks not executed in waitfor ButtonDownFcn and KeyPressFcn callbacks not executing

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code