fix(window): the title a program passes to gl_open / gvk_open reaches the window

The runtime opens a game's window before main, titled with the program's name, and
gl_open attached to it without passing its title on (render3d's gvk_open called win_open,
which returns early on Windows and opened a second window on macOS). win_set_title in
cocoa.ll / win32.ll (setTitle: / SetWindowTextW, UTF-8 -> UTF-16; a no-op without a window,
stubbed headless) retitles it from gl_open, and win_open on an open window retitles it on
both platforms.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-17 14:02:23 +03:00
parent bb267ff3d5
commit 1256bbfec7
7 changed files with 93 additions and 3 deletions

View file

@ -1411,7 +1411,7 @@ function gvk_open(w: int, h: int, title: string) -> bool {
gl_w = w
gl_h = h
if is_windowed() {
win_open(w, h, 1, title)
win_open(w, h, 1, title) # the window exists before main: this retitles it
win_gl_resize(w, h)
if gvk_size_buf == null { gvk_size_buf = words(4) }
win_gl_drawable(gvk_size_buf)