Add opt-in fail-closed Xwayland auto insert

This commit is contained in:
baketnk committed 2026-09-24 16:12:33 -04:00
1 parent 19a3db7667
commit c5e925cb48
27 files changed
+588 -45

No files matched your search

+12
View File
@@ -75,6 +75,18 @@ void delivery_checks() {
CHECK(deliver_enter(s, fake.factory()) == DeliveryResult::EnterQueued);
CHECK((fake.events == std::vector<std::string>{"text:preserve ", "enter"}));
}
{
auto s = review("focus lost during lease"); FakeDelivery fake;
auto acquire = fake.factory();
const DeliveryFactory invalidated_after_acquisition = [&]() -> std::unique_ptr<DeliveryLease> {
auto lease = acquire();
throw std::runtime_error("focus changed while connecting to IME");
};
try { (void)deliver_insert(s, invalidated_after_acquisition); CHECK(false); }
catch (const std::runtime_error&) {}
CHECK(s.state() == State::Review && s.text() == "focus lost during lease");
CHECK(fake.events.empty() && fake.active_leases == 0);
}
{
auto s = review("uncertain"); FakeDelivery fake; fake.fail_text = true;
CHECK(deliver_enter(s, fake.factory()) == DeliveryResult::TextUncertain);