Skip to content

Fix back-key handling #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions flutter/shell/platform/tizen/flutter_tizen_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,21 @@ void FlutterTizenView::OnKey(const char* key,
}

if (engine_->keyboard_channel()) {
bool& backkey_handled = backkey_handled_;
engine_->keyboard_channel()->SendKey(
key, string, compose, modifiers, scan_code, is_down,
[engine = engine_.get(), symbol = std::string(key),
is_down](bool handled) {
[engine = engine_.get(), symbol = std::string(key), is_down,
&backkey_handled](bool handled) {
// If System's back key is handled in key-down, it should be
// handled so that "popRoute" is not called in key-up.
if (symbol == kBackKey) {
if (is_down) {
backkey_handled = handled;
} else {
handled |= backkey_handled;
backkey_handled = false;
}
}
if (handled) {
return;
}
Expand Down
3 changes: 3 additions & 0 deletions flutter/shell/platform/tizen/flutter_tizen_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ class FlutterTizenView : public TizenViewEventHandlerDelegate {
0.0, 0.0, 0.0, 1.0};
// The user-defined pixel ratio.
double user_pixel_ratio_ = 0;

// Whether the back key of the system has been handled.
bool backkey_handled_ = false;
};

} // namespace flutter
Expand Down