Plan keyboard visibility in app core

This commit is contained in:
2026-06-03 03:42:47 +02:00
parent 4af55a7d3f
commit 5ac807c6bd
9 changed files with 123 additions and 4 deletions

View File

@@ -19,6 +19,14 @@ void invoke_picked_path_if_selected(
callback(path);
}
[[nodiscard]] bool should_dispatch_keyboard_visibility(bool visible) noexcept
{
const auto action = pp::app::plan_virtual_keyboard(visible);
return visible
? action == pp::app::VirtualKeyboardAction::show_keyboard
: action == pp::app::VirtualKeyboardAction::hide_keyboard;
}
}
#ifdef __ANDROID__
@@ -132,6 +140,8 @@ void App::showKeyboard()
{
LOG("show keyboard");
redraw = true;
if (!should_dispatch_keyboard_visibility(true))
return;
#ifdef __IOS__
dispatch_async(dispatch_get_main_queue(), ^{
[ios_view show_keyboard];
@@ -145,6 +155,8 @@ void App::hideKeyboard()
{
LOG("hide keyboard");
redraw = true;
if (!should_dispatch_keyboard_visibility(false))
return;
#ifdef __IOS__
dispatch_async(dispatch_get_main_queue(), ^{
[ios_view hide_keyboard];