diff --git a/libs/Dashboard/DashboardEngine.m b/libs/Dashboard/DashboardEngine.m index 2849a48d..07f54b5b 100644 --- a/libs/Dashboard/DashboardEngine.m +++ b/libs/Dashboard/DashboardEngine.m @@ -2016,10 +2016,13 @@ function refreshActivePageWidgetsAfterResize_(obj) return; end ws = obj.activePageWidgets(); + isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0; % --- Pass 1: cheap data re-push --- for i = 1:numel(ws) w = ws{i}; - if isempty(w) || ~isvalid(w) + % Octave 7+ has no isvalid() for classdef handles, so treat + % as valid there and rely on downstream guards / try-catch. + if isempty(w) || (~isOctave && ~isvalid(w)) continue; end if ~w.Realized || isempty(w.hPanel) || ~ishandle(w.hPanel) @@ -2042,10 +2045,10 @@ function refreshActivePageWidgetsAfterResize_(obj) stillWhite = false; for i = 1:numel(ws) w = ws{i}; - if isempty(w) || ~isvalid(w) || ~isa(w, 'FastSenseWidget') + if isempty(w) || (~isOctave && ~isvalid(w)) || ~isa(w, 'FastSenseWidget') continue; end - if isempty(w.FastSenseObj) || ~isvalid(w.FastSenseObj) || ~w.FastSenseObj.IsRendered + if isempty(w.FastSenseObj) || (~isOctave && ~isvalid(w.FastSenseObj)) || ~w.FastSenseObj.IsRendered continue; end if ~obj.isWidgetLineWhite_(w) diff --git a/libs/Dashboard/DashboardLayout.m b/libs/Dashboard/DashboardLayout.m index a2e90370..5e1c72e4 100644 --- a/libs/Dashboard/DashboardLayout.m +++ b/libs/Dashboard/DashboardLayout.m @@ -1035,7 +1035,10 @@ function syncYLimitButtonsState_(bar, mode) inactiveBg = []; if isfield(ud, 'YLimitWidget') && ~isempty(ud.YLimitWidget) w = ud.YLimitWidget; - if isobject(w) && isvalid(w) && ... + % Octave 7+ has no isvalid() for classdef handles; treat as + % valid there and rely on the property-access guards below. + isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0; + if isobject(w) && (isOctave || isvalid(w)) && ... ~isempty(w.ParentTheme) && isstruct(w.ParentTheme) && ... isfield(w.ParentTheme, 'ToolbarBackground') inactiveBg = w.ParentTheme.ToolbarBackground; diff --git a/libs/Dashboard/FastSenseWidget.m b/libs/Dashboard/FastSenseWidget.m index 77c093a7..50d644ce 100644 --- a/libs/Dashboard/FastSenseWidget.m +++ b/libs/Dashboard/FastSenseWidget.m @@ -450,7 +450,11 @@ function autoScaleY_(obj, y) if obj.UserZoomedY return; end - if ~isempty(obj.FastSenseObj) && isvalid(obj.FastSenseObj) && ... + % Octave 7+ has no isvalid() for classdef handles, so treat the + % FastSense handle as valid there and let downstream property + % access surface real failures. + isOctave = exist('OCTAVE_VERSION', 'builtin') ~= 0; + if ~isempty(obj.FastSenseObj) && (isOctave || isvalid(obj.FastSenseObj)) && ... strcmp(obj.FastSenseObj.LiveViewMode, 'follow') return; end