The ecore-wayland has been upgraded by ecore-wl2 since tizen 5.0.
This patch applies the API changes.
Reference: https://review.tizen.org/gerrit/#/c/177221/
Change-Id: I94dc46561cf8624fc1defc60f28f378480eb3b97
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
%endif
%if "%{?_with_wayland}" == "1"
+%if %{tizen_version} >= 50
+BuildRequires: pkgconfig(ecore-wl2)
+%else
BuildRequires: pkgconfig(ecore-wayland)
+%endif
BuildRequires: pkgconfig(wayland-egl)
%else
BuildRequires: pkgconfig(ecore-x)
config("ecore-wayland") {
if (is_tizen && use_wayland) {
- ldflags = [ "-lecore_wayland" ]
+ if (tizen_version >= 50) {
+ ldflags = [ "-lecore_wl2" ]
+ } else {
+ ldflags = [ "-lecore_wayland" ]
+ }
}
}
tizen_pkg_config("libecore-wayland") {
packages = []
if (is_tizen && use_wayland) {
- packages = [ "ecore-wayland" ]
+ if (tizen_version >= 50) {
+ packages = [ "ecore-wl2" ]
+ } else {
+ packages = [ "ecore-wayland" ]
+ }
}
}
config("ecore-wayland-public") {
if (is_tizen && use_wayland) {
- cflags = [ "-ecore-wayland" ]
+ if (tizen_version >= 50) {
+ cflags = [ "-ecore-wl2" ]
+ } else {
+ cflags = [ "-ecore-wayland" ]
+ }
}
}
if (use_efl) {
defines += [ "USE_EFL" ]
+ if (tizen_version >= 50) {
+ defines += [ "EFL_BETA_API_SUPPORT" ]
+ }
}
if (tizen_tbm_support) {
defines += [ "TIZEN_TBM_SUPPORT" ]
}
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+Ecore_Wl2_Window* RenderWidgetHostViewEfl::GetEcoreWlWindow() const {
+ const Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
+ return ecore_evas_wayland2_window_get(ee);
+}
+#else
Ecore_Wl_Window* RenderWidgetHostViewEfl::GetEcoreWlWindow() const {
const Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
return ecore_evas_wayland_window_get(ee);
}
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
Ecore_X_Window RenderWidgetHostViewEfl::GetEcoreXWindow() const {
const Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
return ecore_evas_gl_x11_window_get(ee);
}
-#endif
+#endif // USE_WAYLAND
void RenderWidgetHostViewEfl::SetSize(const gfx::Size& size) {
// This is a hack. See WebContentsView::SizeContents
if (is_loading_) {
// Setting native Loading cursor
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ ecore_wl2_window_cursor_from_name_set(GetEcoreWlWindow(), "watch");
+#else
ecore_wl_window_cursor_from_name_set(GetEcoreWlWindow(), "watch");
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
ecore_x_window_cursor_set(GetEcoreXWindow(),
ecore_x_cursor_shape_get(ECORE_X_CURSOR_CLOCK));
webcursor.GetCursorInfo(&cursor_info);
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ ecore_wl2_window_cursor_from_name_set(GetEcoreWlWindow(),
+ GetCursorName(cursor_info.type));
+#else
ecore_wl_window_cursor_from_name_set(GetEcoreWlWindow(),
GetCursorName(cursor_info.type));
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
int cursor_type = GetCursorType(cursor_info.type);
ecore_x_window_cursor_set(GetEcoreXWindow(),
#include "base/containers/id_map.h"
#include "base/format_macros.h"
+#include "chromium_impl/build/tizen_version.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/frame_sinks/copy_output_result.h"
#include "components/viz/common/quads/compositor_frame.h"
EdgeEffect& EnsureEdgeEffect();
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ Ecore_Wl2_Window* GetEcoreWlWindow() const;
+#else
Ecore_Wl_Window* GetEcoreWlWindow() const;
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
Ecore_X_Window GetEcoreXWindow() const;
#endif
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_pump_ecore.h"
#include "cc/base/switches.h"
+#include "chromium_impl/build/tizen_version.h"
#include "content/common/paths_efl.h"
#include "content/public/common/content_switches.h"
#include "gpu/config/gpu_switches.h"
ecore_init();
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ Ecore_Wl2_Display* _ecore_wl2_display = NULL;
+ if (!ecore_wl2_init())
+ return EINA_FALSE;
+ if (!_ecore_wl2_display)
+ _ecore_wl2_display = ecore_wl2_display_connect(NULL);
+#else
ecore_wl_init(NULL);
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
ecore_x_init(NULL);
#endif
// found in the LICENSE file.
#include "ui/ozone/surface_factory_efl.h"
+#include "chromium_impl/build/tizen_version.h"
#include "ecore_x_wayland_wrapper.h"
protected:
intptr_t GetNativeDisplay() override {
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ Ecore_Wl2_Display* wl2_display = ecore_wl2_connected_display_get(NULL);
+ return reinterpret_cast<intptr_t>(ecore_wl2_display_get(wl2_display));
+#else
return reinterpret_cast<intptr_t>(ecore_wl_display_get());
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
return reinterpret_cast<intptr_t>(ecore_x_display_get());
#endif
#ifndef ECORE_X_WAYLAND_WRAPPER_H_
#define ECORE_X_WAYLAND_WRAPPER_H_
+#include "chromium_impl/build/tizen_version.h"
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+#include <Ecore_Wl2.h>
+#else
#include <Ecore_Wayland.h>
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
#include <Ecore_X.h>
#endif
evas_object_show(popup_);
int width = 0, height = 0;
-#if defined(USE_WAYLAND)
- ecore_wl_screen_size_get(&width, &height);
-#else
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
-#endif
+ const Ecore_Evas* ee = ecore_evas_ecore_evas_get(web_view_->GetEvas());
+ ecore_evas_screen_geometry_get(ee, nullptr, nullptr, &width, &height);
evas_object_resize(popup_, width, height);
evas_object_move(popup_, 0, 0);
return true;
int popupHeight;
int width = 0, height = 0;
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ Ecore_Wl2_Display* wl2_display = ecore_wl2_connected_display_get(NULL);
+ ecore_wl2_display_screen_size_get(wl2_display, &width, &height);
+#else
ecore_wl_screen_size_get(&width, &height);
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif
int width = 0;
int height = 0;
-#if defined(USE_WAYLAND)
- // Screen orientation is already considered in ecore_wl_screen_size_get
- // function.
- ecore_wl_screen_size_get(&width, &height);
-#else
- if (orientation == 0 || orientation == 180) {
- ecore_x_screen_size_get(ecore_x_default_screen_get(), &width, &height);
- } else {
- ecore_x_screen_size_get(ecore_x_default_screen_get(), &height, &width);
- }
-#endif
+ const Ecore_Evas* ee =
+ ecore_evas_ecore_evas_get(evas_object_evas_get(evas_object_));
+ ecore_evas_screen_geometry_get(ee, nullptr, nullptr, &width, &height);
+ if (orientation == 90 || orientation == 270)
+ std::swap(width, height);
+
if (context_menu_)
context_menu_->SetPopupSize(width, height);
if (inputPicker_)
* @brief the log domain identifier that is used with EINA's macros
*/
int _ewk_log_dom = -1;
+#if defined(USE_WAYLAND) && TIZEN_VERSION_AT_LEAST(5, 0, 0)
+Ecore_Wl2_Display* _ecore_wl2_display = NULL;
+#endif
int ewk_init(void)
{
}
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ if (!ecore_wl2_init()) {
+#else
if (!ecore_wl_init(0)) {
- CRITICAL("could not init ecore_wl.");
- goto error_ecore_wl;
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ ERR("could not init ecore_wl.");
+ goto error_ecore_wl;
}
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ if (!_ecore_wl2_display)
+ _ecore_wl2_display = ecore_wl2_display_connect(NULL);
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
if (!ecore_x_init(0)) {
CRITICAL("could not init ecore_x.");
error_edje:
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ if (_ecore_wl2_display) {
+ ecore_wl2_display_disconnect(_ecore_wl2_display);
+ _ecore_wl2_display = NULL;
+ ecore_wl2_shutdown();
+ }
+#else
ecore_wl_shutdown();
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
error_ecore_wl:
#else
ecore_x_shutdown();
edje_shutdown();
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ if (_ecore_wl2_display) {
+ ecore_wl2_display_disconnect(_ecore_wl2_display);
+ _ecore_wl2_display = NULL;
+ ecore_wl2_shutdown();
+ }
+#else
ecore_wl_shutdown();
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
ecore_x_shutdown();
#endif
elm_win_borderless_set(window, EINA_TRUE);
elm_win_conformant_set(window, EINA_TRUE);
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ ecore_wl2_display_screen_size_get(wl2_display, &width, &height);
+#else
ecore_wl_screen_size_get(&width, &height);
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif
void get_main_window_size(int *changed_ang, int *width, int *height)
{
#if defined(USE_WAYLAND)
- // Screen orientation is already considered in ecore_wl_screen_size_get function.
+ // Screen orientation is already considered in ecore_wl*_display_screen_size_get function.
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ ecore_wl2_display_screen_size_get(wl2_display, width, height);
+#else
ecore_wl_screen_size_get(width, height);
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
switch (*changed_ang) {
case APP_DEVICE_ORIENTATION_0:
if (is_imf_shown) {
int width = 0, height = 0;
#if defined(USE_WAYLAND)
+#if TIZEN_VERSION_AT_LEAST(5, 0, 0)
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ ecore_wl2_display_screen_size_get(wl2_display, &width, &height);
+#else
ecore_wl_screen_size_get(&width, &height);
+#endif // TIZEN_VERSION_AT_LEAST(5, 0, 0)
#else
ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif