Context menu separators are added after displaying menu content
Steps to reproduce
- Open Files program
- Right click either on empty space in files view, or on file or directory.
Current behavior
After context menu opens it grows in size after a split second. Only after recording a video it became apparent that at first context menu has no separators and they are added a bit later, after menu is already open, thus increasing context menu height and introducing a bit jarring "animation".
Expected outcome
Context menu should open with all elements already drawn and do not change its size.
Version information
GTK 4.8.2 Files 43.1 (same with current Nightly flatpak version), Fedora Linux 37 (Workstation Edition) with GNOME 43.2
Additional information
Issue can also be observed in "Widget Factory" demo on text area in "Page 2", also in Calculator 43.0.1 using context menu in text field. But as compared to issue in Files application, they seem to be caching layout and subsequent opening of context menu are drawing menu items with separators right away.
Context menu when it shows up:
Context menu few ms later, when separators are added:
I initially reported this issue in GNOME Files repository.