Skip to content
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
2 changes: 1 addition & 1 deletion shell/platform/tizen/channels/platform_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void PlatformChannel::SystemNavigatorPop() {
if (view_->GetType() == TizenViewType::kWindow) {
ui_app_exit();
} else {
reinterpret_cast<TizenView*>(view_)->Unfocus();
reinterpret_cast<TizenView*>(view_)->SetFocus(false);
}
}

Expand Down
18 changes: 18 additions & 0 deletions shell/platform/tizen/flutter_tizen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "flutter/shell/platform/tizen/flutter_tizen_view.h"
#include "flutter/shell/platform/tizen/logger.h"
#include "flutter/shell/platform/tizen/public/flutter_platform_view.h"
#include "flutter/shell/platform/tizen/tizen_view.h"
#include "flutter/shell/platform/tizen/tizen_window.h"
#ifndef WEARABLE_PROFILE
#include "flutter/shell/platform/tizen/tizen_window_ecore_wl2.h"
Expand Down Expand Up @@ -274,6 +275,23 @@ void FlutterDesktopViewOnKeyEvent(FlutterDesktopViewRef view,
is_down);
}

void FlutterDesktopViewSetFocus(FlutterDesktopViewRef view, bool focused) {
auto* tizen_view = reinterpret_cast<flutter::TizenViewBase*>(
ViewFromHandle(view)->tizen_view());
if (tizen_view->GetType() == flutter::TizenViewType::kView) {
reinterpret_cast<flutter::TizenView*>(tizen_view)->SetFocus(focused);
}
}

bool FlutterDesktopViewIsFocused(FlutterDesktopViewRef view) {
auto* tizen_view = reinterpret_cast<flutter::TizenViewBase*>(
ViewFromHandle(view)->tizen_view());
if (tizen_view->GetType() == flutter::TizenViewType::kView) {
return reinterpret_cast<flutter::TizenView*>(tizen_view)->focused();
}
return false;
}

void FlutterDesktopRegisterViewFactory(
FlutterDesktopPluginRegistrarRef registrar,
const char* view_type,
Expand Down
5 changes: 5 additions & 0 deletions shell/platform/tizen/public/flutter_tizen.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ FLUTTER_EXPORT void FlutterDesktopViewOnKeyEvent(FlutterDesktopViewRef view,
uint32_t scan_code,
bool is_down);

FLUTTER_EXPORT void FlutterDesktopViewSetFocus(FlutterDesktopViewRef view,
bool focused);

FLUTTER_EXPORT bool FlutterDesktopViewIsFocused(FlutterDesktopViewRef view);

// ========== Plugin Registrar (extensions) ==========

// Returns the view associated with this registrar's engine instance.
Expand Down
4 changes: 3 additions & 1 deletion shell/platform/tizen/tizen_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class TizenView : public TizenViewBase {

TizenViewType GetType() override { return TizenViewType::kView; };

void Unfocus() { focused_ = false; };
bool focused() { return focused_; };

void SetFocus(bool focused) { focused_ = focused; };

protected:
explicit TizenView(int32_t width, int32_t height)
Expand Down