diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 278380578..2908a6183 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -350,6 +350,8 @@ class CommandDispatcher: new_tabbed_browser.set_page_title(idx, cur_title) if config.get('tabs', 'show-favicons'): new_tabbed_browser.setTabIcon(idx, curtab.icon()) + if config.get('tabs', 'tabs-are-windows'): + new_tabbed_browser.window().setWindowIcon(curtab.icon()) newtab.keep_icon = True newtab.setZoomFactor(curtab.zoomFactor()) history = qtutils.serialize(curtab.history()) diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index 9f027f6f1..df5329345 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -114,6 +114,7 @@ class TabbedBrowser(tabwidget.TabWidget): self._now_focused = None self.search_text = None self.search_flags = 0 + self.default_window_icon = self.window().windowIcon() objreg.get('config').changed.connect(self.update_favicons) objreg.get('config').changed.connect(self.update_window_title) objreg.get('config').changed.connect(self.update_tab_titles) @@ -442,11 +443,16 @@ class TabbedBrowser(tabwidget.TabWidget): def update_favicons(self): """Update favicons when config was changed.""" show = config.get('tabs', 'show-favicons') + tabs_are_wins = config.get('tabs', 'tabs-are-windows') for i, tab in enumerate(self.widgets()): if show: self.setTabIcon(i, tab.icon()) + if tabs_are_wins: + self.window().setWindowIcon(tab.icon()) else: self.setTabIcon(i, QIcon()) + if tabs_are_wins: + self.window().setWindowIcon(self.default_window_icon) @pyqtSlot() def on_load_started(self, tab): @@ -465,6 +471,9 @@ class TabbedBrowser(tabwidget.TabWidget): tab.keep_icon = False else: self.setTabIcon(idx, QIcon()) + if (config.get('tabs', 'tabs-are-windows') and + config.get('tabs', 'show-favicons')): + self.window().setWindowIcon(self.default_window_icon) if idx == self.currentIndex(): self.update_window_title() @@ -533,8 +542,7 @@ class TabbedBrowser(tabwidget.TabWidget): # We can get signals for tabs we already deleted... return self.setTabIcon(idx, tab.icon()) - if idx == self.currentIndex() and config.get('tabs', - 'tabs-are-windows'): + if config.get('tabs', 'tabs-are-windows'): self.window().setWindowIcon(tab.icon()) @pyqtSlot(usertypes.KeyMode)