@@ -160,7 +160,8 @@ WebView::WebView(flutter::PluginRegistrar* registrar, int viewId,
160
160
height_(height),
161
161
tbmSurface_(nullptr ),
162
162
isMouseLButtonDown_(false ),
163
- hasNavigationDelegate_(false ) {
163
+ hasNavigationDelegate_(false ),
164
+ context_(nullptr ) {
164
165
SetTextureId (FlutterRegisterExternalTexture (textureRegistrar_));
165
166
InitWebView ();
166
167
@@ -697,32 +698,51 @@ void WebView::DispatchKeyUpEvent(Ecore_Event_Key* keyEvent) {
697
698
p);
698
699
}
699
700
701
+ void WebView::DispatchCompositionUpdateEvent (const char * str, int size) {
702
+ LOG_DEBUG (" WebView::DispatchCompositionUpdateEvent [%s]" , str);
703
+ webViewInstance_->DispatchCompositionUpdateEvent (std::string (str, size));
704
+ }
705
+
706
+ void WebView::DispatchCompositionEndEvent (const char * str, int size) {
707
+ LOG_DEBUG (" WebView::DispatchCompositionEndEvent [%s]" , str);
708
+ webViewInstance_->DispatchCompositionEndEvent (std::string (str, size));
709
+ }
710
+
711
+ void WebView::ShowPanel () {
712
+ LOG_DEBUG (" WebView - Show Keyboard()\n " );
713
+ if (!context_) {
714
+ LOG_ERROR (" Ecore_IMF_Context NULL\n " );
715
+ return ;
716
+ }
717
+ ecore_imf_context_input_panel_show (context_);
718
+ ecore_imf_context_focus_in (context_);
719
+ }
720
+
721
+ void WebView::HidePanel () {
722
+ LOG_DEBUG (" WebView - Hide Keyboard()\n " );
723
+ if (!context_) {
724
+ LOG_ERROR (" Ecore_IMF_Context NULL\n " );
725
+ return ;
726
+ }
727
+ ecore_imf_context_reset (context_);
728
+ ecore_imf_context_focus_out (context_);
729
+ ecore_imf_context_input_panel_hide (context_);
730
+ }
731
+
700
732
void WebView::SetSoftwareKeyboardContext (Ecore_IMF_Context* context) {
733
+ context_ = context;
734
+
701
735
webViewInstance_->RegisterOnShowSoftwareKeyboardIfPossibleHandler (
702
- [context](LWE::WebContainer* v) {
703
- LOG_DEBUG (" WebView - Show Keyboard()\n " );
704
- if (!context) {
705
- LOG_ERROR (" Ecore_IMF_Context NULL\n " );
706
- return ;
707
- }
708
- ecore_imf_context_input_panel_show (context);
709
- ecore_imf_context_focus_in (context);
710
- });
736
+ [this ](LWE::WebContainer* v) { ShowPanel (); });
711
737
712
738
webViewInstance_->RegisterOnHideSoftwareKeyboardIfPossibleHandler (
713
- [context](LWE::WebContainer*) {
714
- LOG_INFO (" WebView - Hide Keyboard()\n " );
715
- if (!context) {
716
- LOG_INFO (" Ecore_IMF_Context NULL\n " );
717
- return ;
718
- }
719
- ecore_imf_context_reset (context);
720
- ecore_imf_context_focus_out (context);
721
- ecore_imf_context_input_panel_hide (context);
722
- });
739
+ [this ](LWE::WebContainer*) { HidePanel (); });
723
740
}
724
741
725
- void WebView::ClearFocus () { LOG_DEBUG (" WebView::clearFocus \n " ); }
742
+ void WebView::ClearFocus () {
743
+ LOG_DEBUG (" WebView::clearFocus \n " );
744
+ HidePanel ();
745
+ }
726
746
727
747
void WebView::SetDirection (int direction) {
728
748
LOG_DEBUG (" WebView::SetDirection direction: %d\n " , direction);
0 commit comments