Skip to content

Commit

Permalink
Don't report color scheme preference change when it is changed via es…
Browse files Browse the repository at this point in the history
…cape code
  • Loading branch information
kovidgoyal committed Jan 5, 2025
1 parent f3db7e7 commit 6fbeb93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions kitty/boss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,10 +1547,10 @@ def tab_for_id(self, tab_id: int) -> Optional[Tab]:
return tab
return None

def default_bg_changed_for(self, window_id: int) -> None:
def default_bg_changed_for(self, window_id: int, via_escape_code: bool = False) -> None:
w = self.window_id_map.get(window_id)
if w is not None:
w.on_color_scheme_preference_change()
w.on_color_scheme_preference_change(via_escape_code=via_escape_code)
tm = self.os_window_map.get(w.os_window_id)
if tm is not None:
tm.update_tab_bar_data()
Expand Down
6 changes: 3 additions & 3 deletions kitty/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,10 +1323,10 @@ def change(which: DynamicColor, val: str) -> None:
if dirtied:
self.screen.mark_as_dirty()
if default_bg_changed:
get_boss().default_bg_changed_for(self.id)
get_boss().default_bg_changed_for(self.id, via_escape_code=True)

def on_color_scheme_preference_change(self) -> None:
if self.screen.color_preference_notification:
def on_color_scheme_preference_change(self, via_escape_code: bool = False) -> None:
if self.screen.color_preference_notification and not via_escape_code:
self.report_color_scheme_preference()

def report_color_scheme_preference(self) -> None:
Expand Down

0 comments on commit 6fbeb93

Please sign in to comment.