If WINDOW_TITLE_DYNAMIC is enabled it prevents a window icon from being set. Patch attached.
I will recheck gtk_window_set_icon_name() and vte_terminal_get_icon_title().
WINDOW_TITLE_DYNAMIC is an option I rarely use. :-P
I've fixed another bug with WINDOW_TITLE_DYNAMIC. When switching tabs the window title wasn't getting updated in switch_page(). That function wasn't updating current_tab and term globals. It was just setting the title to the old tab's title. I've also been experiencing occasional core dumps when closing tabs, and I think it might be this causing them.
I've attached a patch of all my work (including the MATCH_STRING_EXEC stuff). I hope that's ok.