From 252d8b73f725b8cd51c3f9fc328043730113f998 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Jul 2026 02:42:28 +0000 Subject: [PATCH 1/2] Fix superfluous tab bar margin when background_opacity < 1 (issue #10212) --- docs/changelog.rst | 2 ++ kitty/tab_bar.py | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 5db3e3f38..8141ff4b1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -198,6 +198,8 @@ Detailed list of changes - Make erasing last command robust against commands with no output and commands in the scrollback (:pull:`10201`) +- Fix superfluous margin visible to the left and right of the tab bar when :opt:`background_opacity` is less than one and the window width is not a multiple of the cell width (:iss:`10212`) + 0.47.4 [2026-06-15] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/tab_bar.py b/kitty/tab_bar.py index 94db2f69a..b2e76a8ef 100644 --- a/kitty/tab_bar.py +++ b/kitty/tab_bar.py @@ -23,7 +23,6 @@ from .fast_data_types import ( Color, Region, Screen, - background_opacity_of, cell_size_for_window, get_boss, get_options, @@ -763,11 +762,11 @@ class TabBar: if g.bottom < tab_bar.bottom: blank_rects.append(Border(g.left, g.bottom, g.right, tab_bar.bottom, bg)) else: - left_bg = right_bg = bg - if opts.tab_bar_margin_color is None and ( - opacity := background_opacity_of(self.os_window_id)) is not None and opacity >= 1: + if opts.tab_bar_margin_color is None: left_bg = BorderColor.tab_bar_left_edge_color right_bg = BorderColor.tab_bar_right_edge_color + else: + left_bg = right_bg = bg if g.left > tab_bar.left: blank_rects.append(Border(tab_bar.left, g.top, g.left, g.bottom, left_bg)) if g.right < tab_bar.right: From d68608b35ae97793103b486770acd1c8eedcc9dc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Jul 2026 02:56:41 +0000 Subject: [PATCH 2/2] Fix tab bar edge strips rendered with opacity < 1 when background_opacity < 1 --- kitty/border_vertex.glsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kitty/border_vertex.glsl b/kitty/border_vertex.glsl index adee97510..6e08f942e 100644 --- a/kitty/border_vertex.glsl +++ b/kitty/border_vertex.glsl @@ -52,9 +52,10 @@ void main() { float is_window_bg = is_integer_value(rc, WINDOW_BACKGROUND_PLACEHOLDER); // used by window padding areas float is_default_bg = is_integer_value(rc, DEFAULT_BG); color3 = if_one_then(is_window_bg, window_bg, color3); - // Actual border quads must be always drawn opaque + // Actual border quads and tab bar edge strips must be always drawn opaque float is_not_a_border = zero_or_one(abs( - (float(rc) - ACTIVE_BORDER_COLOR) * (float(rc) - INACTIVE_BORDER_COLOR) * (float(rc) - BELL_BORDER_COLOR) + (float(rc) - ACTIVE_BORDER_COLOR) * (float(rc) - INACTIVE_BORDER_COLOR) * (float(rc) - BELL_BORDER_COLOR) * + (float(rc) - TAB_BAR_EDGE_LEFT_COLOR) * (float(rc) - TAB_BAR_EDGE_RIGHT_COLOR) )); float final_opacity = if_one_then(is_not_a_border, background_opacity, 1.); color_premul = vec4_premul(color3, final_opacity);