Wireshark-dev: Re: [Wireshark-dev] What to do after changing MAC resolution ? Presumedly redraw
From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Date: Tue, 29 Jun 2010 16:00:10 -0700
Bill Meier wrote:
> I'm working on fixing
> bug #4900: "MAC Address Name Resolution Not Working Properly".
> 
> So far: I've fixed the code so that when 'Mac layer name resolution' is 
> changed via
>   'View ! Name Resolution ! Enable for MAC Layer'
>     or
>   'Edit ! Preferences ! Name Resolution'
> the right thing happens the next time a file is reloaded (or a new file 
> is read or a complete redissecttion is done).
> 
> Now I'd like to have the right thing happen directly when the option is 
> changed.
> 
> I'm assuming that redissecting the complete capture is not needed
> when the MAC name resolution option is changed.
> 
> To redraw:
> I see that I can call proto_tree_draw(...) for the packet-details pane.
> 
> How do I redraw the packet_list pane ?
>    new_packet_list_recreate_visible_rows() for "new_packet_list" ??
>    ?? for "old-packet-list" ??
> 
> 
> I expect that the same thing would be done for a change for both
> 'View Name Resolution ! ...' and
> 'Edit ! Preferences ! Name Resolution ! ...'

gtk/main.c:resolv_update_cb has:

  if (host_name_lookup_process(NULL)) {
    if (pkt_scrollw->window)
        gdk_window_invalidate_rect(pkt_scrollw->window, NULL, TRUE);
    if (tv_scrollw->window)
        gdk_window_invalidate_rect(tv_scrollw->window, NULL, TRUE);
  }

You should be able to call gdk_window_invalidate_rect directly or set
new_resolved_objects in addr_resolv.c, which would trigger the redraw
when resolv_update_cb is called.