When and where does Panels get the title out of a View? Two part question about Drupal 7, Panels 3, and Views 3.

I have a view that I have added to a content area in a panels page.  Right now, the title from the display is being used as the pane title.  I need to dynamically set the title of this from a module.  


When does Panels pull out the display title from the view?
Where exactly does it pull it out from?


I cannot seem to override this from any view hook.  For example, 

function foo_views_pre_view (&amp;$view, &amp;$display_id, &amp;$args)
{
    $view-&gt;display[$view-&gt;current_display]-&gt;display_options["title"] = "Foo";
}


doesn't seem to affect the pane title, though the value does propagate through all of the other view hooks.

I suspect I can create a workaround and use a custom block instead of the view directly, but I would rather not do that in this case.

Thanks.
I was hoping that someone would answer this, so I wouldn't have to answer my own question when I found the solution.

Credit goes to a co-worker (who doesn't really post here) who reminded me that you also need to update the handler:

function foo_views_pre_view (&amp;$view, &amp;$display_id, &amp;$args)
{
  $view-&gt;display[$view-&gt;current_display]-&gt;display_options["title"] =
  $view-&gt;display[$view-&gt;current_display]-&gt;handler-&gt;options["title"] = "Foo";
}


When you do this, the title does propagate properly to the pane title.