Hi, using the following test case with Emacs -Q:
(let ((default-directory (file-name-directory load-file-name))) (when (file-exists-p (expand-file-name "default.el" default-directory)) (load-file (expand-file-name "default.el" default-directory)))) (straight-use-package 'org) (require 'org) (load-theme 'leuven t) (dolist (face '(org-level-1 org-level-2 org-level-3 org-level-4 org-level-5 org-level-6 org-level-7 org-level-8)) (set-face-attribute face nil :extend t)) (setq org-fontify-whole-heading-line t) (setq org-startup-folded t) (defvar org-extend-faces-bug-4-file "/tmp/org-extend-faces-bug-4.org" "The file to be used for the bug demo.") (with-temp-buffer (insert "* foo\n** bar\ntest\n** baz\ntest") (write-file org-extend-faces-bug-4-file)) (find-file org-extend-faces-bug-4-file) The most recent fix for the bug in 2da622cad seems to have made things worse. Now sometimes the background of the headline is not extended and other times we still have the trailing background color where it's not supposed to. It's definitely a lot worse when the file is started up folded because the issue seems to be specifically related with unfolding a heading with subheadings. StrawberryTea < Emacs : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0) of 2024-03-04 Package: Org mode version 9.7 (9.7-??-8ac99c33f @ /home/st/.config/emacs/.local/straight/build-30.0.50/org/)