Build the standalone overlay glyph atlas so tab titles render next to icons
overlay_font_init() built the atlas only via the nested init_egl() path, leaving overlay_font_ok false in standalone mode: overlay_text_width() returned 0, so the overlay box sized to the icons alone, and overlay_pass_text() drew no glyphs. Call it from main() once the wlr renderer exists (one-shot guard added so the two call sites never rebuild the atlas), and cover it with a regression test asserting the '[overlay] font' log line from a standalone headless session.
This commit is contained in:
parent
de252181af
commit
98879be1fc
2 changed files with 48 additions and 1 deletions
|
|
@ -707,6 +707,10 @@ static const char *overlay_pick_font(void) {
|
|||
Must be called with the host EGL context current. Non-fatal: on failure
|
||||
the overlay still renders its boxes, just without text. */
|
||||
static void overlay_font_init(void) {
|
||||
static bool overlay_font_done;
|
||||
if (overlay_font_done) return;
|
||||
overlay_font_done = true;
|
||||
|
||||
int px = OVERLAY_FONT_PX;
|
||||
static const char *overlay_font_path = NULL;
|
||||
if (!overlay_ft_lib) {
|
||||
|
|
@ -4539,6 +4543,11 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
wlr_renderer_init_wl_display(server.renderer, server.wl_display);
|
||||
|
||||
/* Standalone has no host EGL context: build the overlay glyph atlas with
|
||||
the wlr renderer instead (nested mode does this inside init_egl()). */
|
||||
if (server.standalone)
|
||||
overlay_font_init();
|
||||
|
||||
server.allocator = wlr_allocator_autocreate(server.backend, server.renderer);
|
||||
if (!server.allocator) {
|
||||
fprintf(stderr, "tabbed-wlroots: failed to create allocator\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue