layouts: fix crash on missed relayout updates (#13444)

This commit is contained in:
Vaxry 2026-02-28 23:06:27 +00:00 committed by GitHub
parent 93aacfc0dc
commit 2928d6af0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 7 deletions

View file

@ -33,6 +33,19 @@ static void swar() {
Tests::killAllWindows();
}
// Don't crash when focus after global geometry changes
static void testCrashOnGeomUpdate() {
Tests::spawnKitty();
Tests::spawnKitty();
Tests::spawnKitty();
// move the layout
OK(getFromSocket("/keyword monitor HEADLESS-2,1920x1080@60,1000x0,1"));
// shouldnt crash
OK(getFromSocket("/dispatch movefocus r"));
}
static bool test() {
NLog::log("{}Testing layout generic", Colors::GREEN);
@ -43,6 +56,8 @@ static bool test() {
NLog::log("{}Testing `single_window_aspect_ratio`", Colors::GREEN);
swar();
testCrashOnGeomUpdate();
// clean up
NLog::log("Cleaning up", Colors::YELLOW);
OK(getFromSocket("/dispatch workspace 1"));