# HG changeset patch # User Pantxo Diribarne # Date 1440359149 -7200 # Node ID 7d7c91ddc736bec491f4e760cb12c00219e480d0 # Parent 7395fdd45d5f70d5afdb15370ada162cf2cb20ce Handle hggroup objects "buttondownfcn" when children are clicked (bug #45621) * Canvas.cc (Canvas::canvasMousePressEvent): when an object is clicked and has an empty "buttondownfcn", execute it's parents "buttondownfcn" if the parent is a hggroup. diff -r 7395fdd45d5f -r 7d7c91ddc736 libgui/graphics/Canvas.cc --- a/libgui/graphics/Canvas.cc Sat Sep 26 10:44:08 2015 +0200 +++ b/libgui/graphics/Canvas.cc Sun Aug 23 21:45:49 2015 +0200 @@ -602,9 +602,20 @@ "windowbuttondownfcn", button_number (event)); - gh_manager::post_callback (currentObj.get_handle (), - "buttondownfcn", - button_number (event)); + if (currentObj.get ("buttondownfcn").is_empty ()) + { + graphics_object parentObj = + gh_manager::get_object (currentObj.get_parent ()); + + if (parentObj.valid_object () && parentObj.isa ("hggroup")) + gh_manager::post_callback (parentObj.get_handle (), + "buttondownfcn", + button_number (event)); + } + else + gh_manager::post_callback (currentObj.get_handle (), + "buttondownfcn", + button_number (event)); if (event->button () == Qt::RightButton) ContextMenu::executeAt (currentObj.get_properties (),