mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#805
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/769
Author: @Andretuta
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142
Base:
main← Head:feat/gdk-lifecycle-window-hook📝 Commits (3)
b358d90lifecycle: suspend callbacks on window close and fit the title window (split from #401)f9792ccMerge remote-tracking branch 'ubiq/main' into feat/gdk-lifecycle-window-hook8b77190Merge main into feat/gdk-lifecycle-window-hook (#769)📊 Changes
6 files changed (+484 additions, -2 deletions)
View changed files
📝
docs/runtime_imports.md(+10 -0)📝
runtime/CMakeLists.txt(+16 -0)➕
runtime/shims/lifecycle.cpp(+254 -0)➕
runtime/shims/lifecycle.h(+21 -0)➕
runtime/test/lifecycle_test.cpp(+181 -0)📝
scripts/build_runtime.ps1(+2 -2)📄 Description
Claimed in the coordination issue as:
RT-GDK-SPEECH-DISPLAY-LIFECYCLE(https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121796272). Split from #401 at the maintainer's request (one topic per pull request).What and why
Console titles never get a desktop
WM_CLOSE: quitting suspends the title (itsRegisterAppStateChangeNotificationcallbacks run withquiescedTRUE so it can flush saves) and then ends the process. They also size their window for a 4K render target, which overflows smaller desktops.runtime/shims/lifecycle.{h,cpp}:RegisterAppStateChangeNotification/UnregisterAppStateChangeNotificationunderapi-ms-win-core-psm-appnotify-l1-1-0.dll,api-ms-win-core-psm-appnotify-l1-1-1.dllandkernelbase.dll.CreateWindowExW/CreateWindowExAunderuser32.dllandext-ms-win-rtcore-ntuser-window-l1-1-0/-l1-1-1.dll, andCreateWindowExAunderext-ms-win-rtcore-ntuser-window-ansi-l1-1-0.dll. The title's import table namesCreateWindowExAfrom that ANSI set andRegisterAppStateChangeNotificationfromapi-ms-win-core-psm-appnotify-l1-1-0(tools/pe_inspect.py). The version in #401 missed the ANSI set, so the game's window would never have been hooked. Only the title's first top-level window (no parent, notWS_CHILD, notWS_EX_TOOLWINDOW) is fitted to the primary monitor's work area and hooked.SC_CLOSEruns the registered suspend callbacks under the registration lock, off the window thread, then ends the run through the title's ownExitProcessshim (process.cpp), so the host finishes its cleanup. The deadline is 1 s: if the callbacks have not returned by then, the run ends the same way.UnregisterAppStateChangeNotificationis never called after it returned.lifecycle_testinruntime/CMakeLists.txt;scripts/build_runtime.ps1addsshims\lifecycle.cppanduser32.libto theclfallback; one paragraph indocs/runtime_imports.md.The code is #401's lifecycle part (as of
a02134a9c) on currentmain, plus the ANSI window set.Tested
lifecycle_test30 checks, 0 failures, under CTest (new:CreateWindowExAbinds through the ANSI set to the same shim).test_gdk_runtime_callspytest: 82 passed.git merge-tree).GPUs tested: n/a (CPU-only Win32 tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — runtime shims only)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.