URL:
  <https://savannah.gnu.org/bugs/?68644>

                 Summary: gfxmenu framebuffer remains visible during automatic
timeout boot but is cleared on Enter
                   Group: GNU GRUB
               Submitter: pujx0415
               Submitted: Tue 25 Aug 2026 08:06:18 AM UTC
                Category: User Interface
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked
                 Release: other
                 Release:
         Reproducibility: Every Time
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 25 Aug 2026 08:06:18 AM UTC By: Sai <pujx0415>
## Environment

- GRUB: `2.14-2ubuntu2`
- Distribution: Ubuntu 26.04 LTS
- Platform: x86_64 UEFI
- Menu: visible graphical `gfxmenu` with a theme and a 5-second timeout
- Default entry: Windows Boot Manager, chainloaded through the entry generated
by `30_os-prober`
- Reproducibility: every boot

The same control-flow asymmetry is still present in current upstream master at
commit `b07cc37ca64fe99260884e7325abc333374e098b` as of 2026-08-25.

## Steps to reproduce

1. Configure a visible graphical GRUB menu with a theme and a nonzero
timeout.
2. Make a Windows EFI chainloader entry the default selection.
3. Boot and let the timeout reach zero without pressing a key.
4. Observe the handoff to Windows.
5. Reboot, select the same entry, and press Enter before the timeout expires.

## Actual result

When the timeout expires, the final GRUB theme frame remains on screen for
several seconds while the Windows boot spinner is drawn over it.

When Enter is pressed on the same selected entry, GRUB clears the display
before executing it, so the retained-theme overlay does not occur.

Changing the GRUB theme does not change the behavior.

## Expected result

A visible graphical menu should be cleared before executing the selected entry
in both the timeout and Enter paths. Hidden-menu boots should retain their
current flicker-free behavior.

## Source analysis

In `grub-core/normal/menu.c`:

- The visible timeout path in `run_menu()` sets `*auto_boot = 1`, calls
`menu_fini()`, and returns the default entry.
- The Enter path calls `menu_fini()`, sets `*auto_boot = 0`, and returns the
selected entry.
- In `show_menu()`, the `auto_boot` branch directly calls
`grub_menu_execute_with_fallback()`.
- Only the manual branch calls `grub_cls()` before
`grub_menu_execute_entry()`.

In `grub-core/gfxmenu/gfxmenu.c`, `grub_gfxmenu_viewer_fini()` is empty, so
`menu_fini()` does not clear the graphical framebuffer.

Current source:

- `grub-core/normal/menu.c`:
https://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/normal/menu.c?id=b07cc37ca64fe99260884e7325abc333374e098b
- `grub-core/gfxmenu/gfxmenu.c`:
https://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/gfxmenu/gfxmenu.c?id=b07cc37ca64fe99260884e7325abc333374e098b

This appears related to the 2024 change that moved `grub_cls()` into the
manual-execution branch to preserve hidden-menu flicker-free behavior:

- https://lists.gnu.org/archive/html/grub-devel/2024-10/msg00012.html
- https://lists.gnu.org/archive/html/grub-devel/2024-10/msg00031.html

That discussion explicitly recommends an entry-level `clear` command when a
universal clear would conflict with flicker-free booting. This report covers a
narrower case: the menu was visibly rendered, but timeout execution does not
clear it while Enter execution does.

## Workaround

Adding `clear` immediately before the Windows EFI `chainloader` command makes
the generated entry take the intended clear-screen path:

```grub
clear
chainloader /efi/Microsoft/Boot/bootmgfw.efi
```

A possible upstream direction would be to clear only when a graphical or
otherwise visible menu was actually shown before automatic execution, while
leaving truly hidden-menu boots unchanged.








    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68644>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to