# HG changeset patch
# User Pantxo Diribarne <pantxo.diribarne@gmail.com>
# Date 1710273096 -3600
#      Tue Mar 12 20:51:36 2024 +0100
# Branch stable
# Node ID b267059251c252f3077dfbcd0163547a76e042c2
# Parent  430eccf64677f127eb24aa7914cf2997d8c74e26
legend.m: fix error with showhiddenhandles on (bug #65442)

* legend.m (update_layout_cb): Make sure the root "showhiddenhandles" property
  is off so that labels are not visible in children list. 
                                                 
diff -r 430eccf64677 -r b267059251c2 scripts/plot/appearance/legend.m
--- a/scripts/plot/appearance/legend.m	Mon Mar 11 17:44:16 2024 +0100
+++ b/scripts/plot/appearance/legend.m	Tue Mar 12 20:51:36 2024 +0100
@@ -911,6 +911,10 @@
   units = get (hl, "units");
   set (hl, "units", "points");
 
+  ## Make sure legend title and labels are invisible
+  hvisibility = get (groot, "showhiddenhandles");
+  set (groot, "showhiddenhandles", "off");
+
   unwind_protect
 
     pos = get (hl, "position");
@@ -959,6 +963,7 @@
 
   unwind_protect_cleanup
     set (hl, "units", units);
+    set (groot, "showhiddenhandles", hvisibility);
     setappdata (hl, "__updating_layout__", false);
   end_unwind_protect
 
