diff options
Diffstat (limited to 'lib/observer')
-rw-r--r-- | lib/observer/src/observer_trace_wx.erl | 1 | ||||
-rw-r--r-- | lib/observer/src/observer_wx.erl | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl index 7df599c602..af90e2100c 100644 --- a/lib/observer/src/observer_trace_wx.erl +++ b/lib/observer/src/observer_trace_wx.erl @@ -774,6 +774,7 @@ do_add_pid_or_port(POpts, Nview, LCtrl, OldPs, Ns0, Check) -> {Ps, New, _Changed} -> Ns1 = lists:usort([node(Id) || #titem{id=Id} <- New, Check(Id)]), Nodes = case ordsets:subtract(Ns1, Ns0) of + [] when Ns0==[] -> [observer_wx:get_active_node()]; [] -> Ns0; %% No new Nodes NewNs -> ordsets:union(NewNs, Ns0) end, diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl index d896da1291..29778f6d13 100644 --- a/lib/observer/src/observer_wx.erl +++ b/lib/observer/src/observer_wx.erl @@ -21,8 +21,8 @@ -behaviour(wx_object). -export([start/0, stop/0]). --export([create_menus/2, get_attrib/1, get_tracer/0, set_status/1, - create_txt_dialog/4, try_rpc/4, return_to_localnode/2]). +-export([create_menus/2, get_attrib/1, get_tracer/0, get_active_node/0, + set_status/1, create_txt_dialog/4, try_rpc/4, return_to_localnode/2]). -export([init/1, handle_event/2, handle_cast/2, terminate/2, code_change/3, handle_call/3, handle_info/2, check_page_title/1]). @@ -90,6 +90,9 @@ set_status(What) -> get_tracer() -> wx_object:call(observer, get_tracer). +get_active_node() -> + wx_object:call(observer, get_active_node). + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% init(_Args) -> @@ -385,6 +388,9 @@ handle_call({get_attrib, Attrib}, _From, State) -> handle_call(get_tracer, _From, State=#state{trace_panel=TraceP}) -> {reply, TraceP, State}; +handle_call(get_active_node, _From, State=#state{node=Node}) -> + {reply, Node, State}; + handle_call(stop, _, State = #state{frame = Frame}) -> wxFrame:destroy(Frame), {stop, normal, ok, State}; |