diff --git a/kitty/screen.c b/kitty/screen.c index e3d8ea18e..8ab43e287 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -2092,7 +2092,12 @@ screen_push_colors(Screen *self, unsigned int idx) { void screen_pop_colors(Screen *self, unsigned int idx) { - if (colorprofile_pop_colors(self->color_profile, idx)) self->color_profile->dirty = true; + color_type bg_before = colorprofile_to_color(self->color_profile, self->color_profile->overridden.default_bg, self->color_profile->configured.default_bg).rgb; + if (colorprofile_pop_colors(self->color_profile, idx)) { + self->color_profile->dirty = true; + color_type bg_after = colorprofile_to_color(self->color_profile, self->color_profile->overridden.default_bg, self->color_profile->configured.default_bg).rgb; + CALLBACK("color_profile_popped", "O", bg_before == bg_after ? Py_False : Py_True); + } } void diff --git a/kitty/window.py b/kitty/window.py index ba34e80cc..7accc33d6 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -862,6 +862,10 @@ class Window: if default_bg_changed: get_boss().default_bg_changed_for(self.id) + def color_profile_popped(self, bg_changed: bool) -> None: + if bg_changed: + get_boss().default_bg_changed_for(self.id) + def report_color(self, code: str, r: int, g: int, b: int) -> None: r |= r << 8 g |= g << 8