Sometimes when switching from steam to a different workspace and back only the outer window takes focus so some actions don't work. Tentative fix for that.

This commit is contained in:
Storm Dragon committed 2026-10-14 19:51:07 -04:00
1 parent 9205e7280a
commit 12c514aab0
19 files changed
+798 -30

No files matched your search

+30
View File
@@ -83,3 +83,33 @@ func TestSelectionIntentEndsWithPlainNavigation(t *testing.T) {
t.Fatalf("Right = %+v", got)
}
}
func TestTitleInterruptionTracksFreshPressesAndStopKeys(t *testing.T) {
tracker := &IntentTracker{}
for _, step := range []struct {
name string
pressed bool
repeat bool
want uint64
}{
{"a", true, false, 1}, {"a", false, false, 1},
{"a", true, true, 1}, {"Down", true, false, 2},
{"Down", true, true, 2}, {"Control_L", true, true, 3},
{"Control_R", true, true, 4}, {"Escape", true, true, 5},
} {
event := NewKeyEvent(0, step.pressed, step.name)
event.Repeat = step.repeat
tracker.Observe(event)
if got := tracker.RecentInput().TitleInterruptionSequence; got != step.want {
t.Fatalf("%+v: title interruption sequence = %d", step, got)
}
}
tracker.at = time.Now().Add(-2 * time.Second)
if got := tracker.RecentInput(); got.Intent != NoIntent || got.TitleInterruptionSequence != 5 {
t.Fatalf("expired activity = %+v", got)
}
tracker.Reset()
if got := tracker.RecentInput().TitleInterruptionSequence; got != 5 {
t.Fatalf("reset lost interruption history: %d", got)
}
}