Change to latest wayland inputmethod protocol 97/269597/2
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Thu, 20 Jan 2022 05:08:34 +0000 (14:08 +0900)
committerDaekwang Ryu <dkdk.ryu@samsung.com>
Thu, 20 Jan 2022 05:08:34 +0000 (14:08 +0900)
refer to
https://review.tizen.org/gerrit/#/c/platform/core/uifw/wayland-extension/+/266078/
https://review.tizen.org/gerrit/#/c/platform/core/uifw/wayland-extension/+/266733/

Change-Id: I50125dbac00420abc96040bd27b7a46e340f3637

dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
packaging/dali-adaptor.spec

index ccea97c..5ee11be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -2614,10 +2614,17 @@ void WindowBaseEcoreWl2::InitializeIme()
 
   EINA_ITERATOR_FOREACH(globals, global)
   {
+#ifdef OVER_TIZEN_VERSION_7
+    if(strcmp(global->interface, "zwp_input_panel_v1") == 0)
+    {
+      mWlInputPanel = (zwp_input_panel_v1*)wl_registry_bind(registry, global->id, &zwp_input_panel_v1_interface, 1);
+    }
+#else
     if(strcmp(global->interface, "wl_input_panel") == 0)
     {
       mWlInputPanel = (wl_input_panel*)wl_registry_bind(registry, global->id, &wl_input_panel_interface, 1);
     }
+#endif
     else if(strcmp(global->interface, "wl_output") == 0)
     {
       mWlOutput = (wl_output*)wl_registry_bind(registry, global->id, &wl_output_interface, 1);
@@ -2635,15 +2642,21 @@ void WindowBaseEcoreWl2::InitializeIme()
     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland output panel interface\n");
     return;
   }
-
+#ifdef OVER_TIZEN_VERSION_7
+  mWlInputPanelSurface = zwp_input_panel_v1_get_input_panel_surface(mWlInputPanel, mWlSurface);
+#else
   mWlInputPanelSurface = wl_input_panel_get_input_panel_surface(mWlInputPanel, mWlSurface);
+#endif
   if(!mWlInputPanelSurface)
   {
     DALI_LOG_ERROR("WindowBaseEcoreWl2::InitializeIme(), fail to get wayland input panel surface\n");
     return;
   }
-
+#ifdef OVER_TIZEN_VERSION_7
+  zwp_input_panel_surface_v1_set_toplevel(mWlInputPanelSurface, mWlOutput, ZWP_INPUT_PANEL_SURFACE_V1_POSITION_CENTER_BOTTOM);
+#else
   wl_input_panel_surface_set_toplevel(mWlInputPanelSurface, mWlOutput, WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
+#endif
 }
 
 void WindowBaseEcoreWl2::ImeWindowReadyToRender()
@@ -2653,8 +2666,11 @@ void WindowBaseEcoreWl2::ImeWindowReadyToRender()
     DALI_LOG_ERROR("WindowBaseEcoreWl2::ImeWindowReadyToRender(), wayland input panel surface is null\n");
     return;
   }
-
+#ifdef OVER_TIZEN_VERSION_7
+  zwp_input_panel_surface_v1_set_ready(mWlInputPanelSurface, 1);
+#else
   wl_input_panel_surface_set_ready(mWlInputPanelSurface, 1);
+#endif
 }
 
 void WindowBaseEcoreWl2::RequestMoveToServer()
index 3df827b..f5fd0ea 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL2_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -176,7 +176,6 @@ public:
    */
   void OnEcoreEventWindowAuxiliaryMessage(void* event);
 
-
 #ifdef DALI_ELDBUS_AVAILABLE
   /**
    * @brief Called when Ecore ElDBus accessibility event is received.
@@ -548,10 +547,18 @@ private:
   Dali::Vector<Ecore_Event_Handler*>                        mEcoreEventHandler;
   Ecore_Wl2_Window*                                         mEcoreWindow;
 
-  wl_surface*             mWlSurface;
-  wl_input_panel*         mWlInputPanel;
-  wl_output*              mWlOutput;
+  wl_surface* mWlSurface;
+#ifdef OVER_TIZEN_VERSION_7
+  zwp_input_panel_v1* mWlInputPanel;
+#else
+  wl_input_panel* mWlInputPanel;
+#endif
+  wl_output* mWlOutput;
+#ifdef OVER_TIZEN_VERSION_7
+  zwp_input_panel_surface_v1* mWlInputPanelSurface;
+#else
   wl_input_panel_surface* mWlInputPanelSurface;
+#endif
 
   wl_egl_window*        mEglWindow;
   wl_display*           mDisplay;
index 8e6da38..d586f45 100644 (file)
@@ -282,6 +282,11 @@ CXXFLAGS+=" -DECORE_WAYLAND2 -DEFL_BETA_API_SUPPORT"
 cmake_flags+=" -DENABLE_ECORE_WAYLAND2=ON"
 %endif
 
+# Use this conditional when Tizen version is 7.x or greater
+%if 0%{?tizen_version_major} >= 7
+CXXFLAGS+=" -DOVER_TIZEN_VERSION_7"
+%endif
+
 %if 0%{?enable_debug}
 cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
 %endif