From 8bfbf36713ffd8b64c0c85d342837859cc95dbd1 Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 20 Feb 2018 17:04:04 +0900 Subject: [PATCH 01/16] Do not send duplicated cancel Change-Id: I03208d6fc2c9776c957460448f2fa777c3f3b930 Signed-off-by: hyunho --- screen_connector_remote_surface/trs_internal.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/screen_connector_remote_surface/trs_internal.h b/screen_connector_remote_surface/trs_internal.h index caf4ace..593a3de 100644 --- a/screen_connector_remote_surface/trs_internal.h +++ b/screen_connector_remote_surface/trs_internal.h @@ -54,6 +54,9 @@ class TRS : public Handle, public ITRS { } void TransferTouchCancel() override { + if (!is_down_) + return; + is_down_ = false; tizen_remote_surface_transfer_touch_cancel(GetRaw()); } @@ -108,6 +111,10 @@ class TRS : public Handle, public ITRS { wl_fixed_t pressure, wl_fixed_t angle, uint32_t clas, uint32_t subclas, const char *identifier, uint32_t time) override { + if (event_type == TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_DOWN) + is_down_ = true; + else if (event_type == TIZEN_REMOTE_SURFACE_EVENT_TYPE_MOUSE_UP) + is_down_ = false; tizen_remote_surface_transfer_mouse_event(GetRaw(), event_type, device, button, x, y, radius_x, radius_y, pressure, angle, clas, subclas, identifier, time); @@ -151,6 +158,7 @@ class TRS : public Handle, public ITRS { private: ITRS::IEventListener* listener_ = nullptr; + bool is_down_ = false; }; } // namespace screen_connector -- 2.7.4 From 9d7baeac713a3d00ee9988b50d117288494a63b5 Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 5 Mar 2018 17:50:30 +0900 Subject: [PATCH 02/16] Release version 1.3.2 Changes: - Do not send duplicated cancel Change-Id: Ia03cc8f3aff36ea73afb4049a61e1c6791dfa288 Signed-off-by: hyunho --- packaging/libscreen_connector.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscreen_connector.spec b/packaging/libscreen_connector.spec index 3effff7..ddf90be 100644 --- a/packaging/libscreen_connector.spec +++ b/packaging/libscreen_connector.spec @@ -1,6 +1,6 @@ Name: libscreen_connector Summary: Library for developing the application -Version: 1.3.1 +Version: 1.3.2 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 9ba8ff233485dfb0d82b7ebb655897e8f608776c Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 13 Mar 2018 16:37:17 +0900 Subject: [PATCH 03/16] Add exception handling logic Change-Id: I48b9b75612afb9d8109f33f22646d3bb354e52fd Signed-off-by: hyunho --- unittest/src/sc_test_main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unittest/src/sc_test_main.cpp b/unittest/src/sc_test_main.cpp index 6efbf98..14fe324 100644 --- a/unittest/src/sc_test_main.cpp +++ b/unittest/src/sc_test_main.cpp @@ -2,6 +2,10 @@ #include int main(int argc, char** argv){ - testing::InitGoogleTest(&argc, argv); + try { + testing::InitGoogleTest(&argc, argv); + } catch(...) { + std::cout << "Exception occurred" << std::endl; + } return RUN_ALL_TESTS(); } -- 2.7.4 From c37fa6a5ab4340f6d0ec457ee3a5b5e433524db3 Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 13 Mar 2018 16:41:35 +0900 Subject: [PATCH 04/16] Initialize pointer Change-Id: I3f80b2dafa23416e4e2516d3d4739b1884119504 Signed-off-by: hyunho --- screen_connector_remote_surface/aul_handle_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screen_connector_remote_surface/aul_handle_internal.h b/screen_connector_remote_surface/aul_handle_internal.h index e42ac71..950312e 100644 --- a/screen_connector_remote_surface/aul_handle_internal.h +++ b/screen_connector_remote_surface/aul_handle_internal.h @@ -74,7 +74,7 @@ class AulHandle { private: IEventListener* listener_; - aul_screen_viewer_h handle_; + aul_screen_viewer_h handle_ = NULL; }; } // namespace screen_connector -- 2.7.4 From ae03b1d3fdefda0da7307f77380f13ec56bfdc82 Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 15 Mar 2018 10:35:07 +0900 Subject: [PATCH 05/16] Release version 1.3.3 Changes: - Add exception handling logic - Initialize pointer Change-Id: Id61b6d133ac199435283c6a612ec8fbd02996dbc Signed-off-by: hyunho --- packaging/libscreen_connector.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscreen_connector.spec b/packaging/libscreen_connector.spec index ddf90be..3e0442e 100644 --- a/packaging/libscreen_connector.spec +++ b/packaging/libscreen_connector.spec @@ -1,6 +1,6 @@ Name: libscreen_connector Summary: Library for developing the application -Version: 1.3.2 +Version: 1.3.3 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 16f1cc560d473aef85ed9d30dd9575c8c666af01 Mon Sep 17 00:00:00 2001 From: hyunho Date: Wed, 10 Jan 2018 17:23:06 +0900 Subject: [PATCH 06/16] EFL_UPGRADE: remove ecore-wayland dependency Change-Id: Ibbd0f7062ae94abf6c6493b7fccd87eaa4d2dcfe Signed-off-by: hyunho --- packaging/libscreen_connector.spec | 5 +- screen_connector_provider/CMakeLists.txt | 2 +- .../src/screen_connector_provider.c | 46 ++++++++++++------- screen_connector_remote_surface/CMakeLists.txt | 2 +- screen_connector_remote_surface/handle.h | 2 +- .../remote_surface_manager.cc | 53 ++++++++++++++-------- .../remote_surface_manager_internal.h | 2 +- .../CMakeLists.txt | 2 +- .../remote_surface_evas.cc | 35 ++++++++------ .../remote_surface_mixed.cc | 2 +- .../remote_surface_watcher.cc | 2 +- screen_connector_watcher/CMakeLists.txt | 2 +- .../src/screen_connector_toolkit.cc | 2 +- .../src/screen_connector_toolkit_evas.cc | 4 +- .../src/screen_connector_watcher_evas.cc | 2 +- 15 files changed, 99 insertions(+), 64 deletions(-) diff --git a/packaging/libscreen_connector.spec b/packaging/libscreen_connector.spec index 3e0442e..d0fef92 100644 --- a/packaging/libscreen_connector.spec +++ b/packaging/libscreen_connector.spec @@ -18,7 +18,7 @@ BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(wayland-tbm-client) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(wayland-client) -BuildRequires: pkgconfig(ecore-wayland) +BuildRequires: pkgconfig(ecore-wl2) BuildRequires: pkgconfig(gmock) %description @@ -41,6 +41,9 @@ cp %{SOURCE1004} . cp %{SOURCE1005} . %build + +export CFLAGS+=" -DEFL_BETA_API_SUPPORT " +export CXXFLAGS+=" -DEFL_BETA_API_SUPPORT " MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` %cmake . -DTZ_SYS_SHARE=/usr/share -DMAJORVER=${MAJORVER} -DFULLVER=%{version} make %{?jobs:-j%jobs} diff --git a/screen_connector_provider/CMakeLists.txt b/screen_connector_provider/CMakeLists.txt index 2e5280c..6911888 100644 --- a/screen_connector_provider/CMakeLists.txt +++ b/screen_connector_provider/CMakeLists.txt @@ -15,7 +15,7 @@ pkg_check_modules(screen_connector_provider REQUIRED wayland-tbm-client elementary wayland-client - ecore-wayland + ecore-wl2 tizen-remote-surface-client ) diff --git a/screen_connector_provider/src/screen_connector_provider.c b/screen_connector_provider/src/screen_connector_provider.c index b6e73d8..671ef5a 100755 --- a/screen_connector_provider/src/screen_connector_provider.c +++ b/screen_connector_provider/src/screen_connector_provider.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ struct screen_connector_provider_s { struct wl_surface *surface; struct tizen_remote_surface_provider *rsp; char *id; - Ecore_Wl_Window *win; + Ecore_Wl2_Window *win; }; static void __rsp_resource_id_cb(void *data, struct tizen_remote_surface_provider *provider, uint32_t res_id) @@ -61,15 +61,15 @@ static void __rsp_resource_id_cb(void *data, struct tizen_remote_surface_provide static void __rsp_visibility_cb(void *data, struct tizen_remote_surface_provider *provider, uint32_t visibility) { struct screen_connector_provider_s *remote = (struct screen_connector_provider_s *)data; - Ecore_Wl_Event_Window_Visibility_Change *ev; + Ecore_Wl2_Event_Window_Visibility_Change *ev; - ev = calloc(1, sizeof(Ecore_Wl_Event_Window_Visibility_Change)); + ev = calloc(1, sizeof(Ecore_Wl2_Event_Window_Visibility_Change)); if (!ev) { LOGE("out of memory"); return; } - ev->win = ecore_wl_window_id_get(remote->win); + ev->win = ecore_wl2_window_id_get(remote->win); if (visibility == TIZEN_REMOTE_SURFACE_PROVIDER_VISIBILITY_TYPE_VISIBLE) ev->fully_obscured = 0; @@ -78,7 +78,7 @@ static void __rsp_visibility_cb(void *data, struct tizen_remote_surface_provider LOGD("visibility changed:%d", visibility); - ecore_event_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, ev, NULL, NULL); + ecore_event_add(ECORE_WL2_EVENT_WINDOW_VISIBILITY_CHANGE, ev, NULL, NULL); } static const struct tizen_remote_surface_provider_listener __rsp_listener = { @@ -109,7 +109,7 @@ EXPORT_API screen_connector_provider_h screen_connector_provider_create(const ch goto out; } - display = ecore_wl_display_get(); + display = ecore_wl2_display_get(ecore_wl2_connected_display_get(NULL)); if (!display) { LOGE("Fail to get"); goto out; @@ -125,7 +125,7 @@ EXPORT_API screen_connector_provider_h screen_connector_provider_create(const ch } remote->surface = surface; - remote->win = ecore_wl_window_surface_find(surface); + remote->win = ecore_wl2_window_surface_find(surface); if (!remote->win) { LOGE("failed to find win"); free(remote); @@ -194,30 +194,42 @@ EXPORT_API int screen_connector_provider_set_event_filter(screen_connector_provi return 0; } +static void __shutdown_ecore_wl2_display() { + LOGE("disconnect wl2_display"); + ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); + ecore_wl2_shutdown(); +} + EXPORT_API int screen_connector_provider_init(void) { struct wl_registry *registry; - Ecore_Wl_Global *global; - Eina_Inlist *globals; + Ecore_Wl2_Global *global; + Eina_Iterator *globals; if (__init_count > 0) { __init_count++; return 0; } - ecore_wl_init(NULL); + if (!ecore_wl2_init()) { + LOGE("could not wl2 init"); + return -1; + } - registry = ecore_wl_registry_get(); - globals = ecore_wl_globals_get(); + ecore_wl2_display_connect(NULL); + registry = ecore_wl2_display_registry_get( + ecore_wl2_connected_display_get(NULL)); + globals = ecore_wl2_display_globals_get( + ecore_wl2_connected_display_get(NULL)); if (!registry || !globals) { LOGE("could not get registry(%p) or global list(%p)", registry, globals); - ecore_wl_shutdown(); + __shutdown_ecore_wl2_display(); return -1; } - EINA_INLIST_FOREACH(globals, global) { + EINA_ITERATOR_FOREACH(globals, global) { if (!strcmp(global->interface, "tizen_remote_surface_manager")) { __rsm = wl_registry_bind(registry, global->id, &tizen_remote_surface_manager_interface, @@ -227,7 +239,7 @@ EXPORT_API int screen_connector_provider_init(void) if (!__rsm) { LOGE("could not get remote surface manager"); - ecore_wl_shutdown(); + __shutdown_ecore_wl2_display(); return -1; } __init_count++; @@ -245,7 +257,7 @@ EXPORT_API int screen_connector_provider_fini(void) if (__rsm) tizen_remote_surface_manager_destroy(__rsm); - ecore_wl_shutdown(); + __shutdown_ecore_wl2_display(); __init_count--; return 0; diff --git a/screen_connector_remote_surface/CMakeLists.txt b/screen_connector_remote_surface/CMakeLists.txt index ae8193f..bfa7054 100644 --- a/screen_connector_remote_surface/CMakeLists.txt +++ b/screen_connector_remote_surface/CMakeLists.txt @@ -14,7 +14,7 @@ pkg_check_modules(screen_connector_remote_surface REQUIRED aul wayland-tbm-client wayland-client - ecore-wayland + ecore-wl2 tizen-remote-surface-client ) diff --git a/screen_connector_remote_surface/handle.h b/screen_connector_remote_surface/handle.h index 9d5189e..1ab7157 100644 --- a/screen_connector_remote_surface/handle.h +++ b/screen_connector_remote_surface/handle.h @@ -17,7 +17,7 @@ #ifndef SCREEN_CONNECTOR_REMOTE_SURFACE_HANDLE_H_ #define SCREEN_CONNECTOR_REMOTE_SURFACE_HANDLE_H_ -#include +#include #include #include #include diff --git a/screen_connector_remote_surface/remote_surface_manager.cc b/screen_connector_remote_surface/remote_surface_manager.cc index 886b334..eb92a67 100644 --- a/screen_connector_remote_surface/remote_surface_manager.cc +++ b/screen_connector_remote_surface/remote_surface_manager.cc @@ -38,9 +38,9 @@ RemoteSurfaceManager& RemoteSurfaceManager::GetInst(bool mock) { ITRS* RemoteSurfaceManager::CreateTRS(int rid, bool mock) { return mock ? - new test::TRSMock() : - new TRS(tizen_remote_surface_manager_create_surface(rsm_, - (uint32_t)rid, tbm_), true); + new test::TRSMock() : + new TRS(tizen_remote_surface_manager_create_surface(rsm_, + (uint32_t)rid, tbm_), true); } RemoteSurfaceManager::RemoteSurfaceManager() { @@ -65,51 +65,64 @@ void RemoteSurfaceManager::Dispose() { rsm_ = nullptr; } - ecore_wl_shutdown(); + LOGE("disconnect wl2_display"); + ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); + ecore_wl2_shutdown(); is_init_ = false; } void RemoteSurfaceManager::Init() { struct wl_registry* registry; - Ecore_Wl_Global* global; - Eina_Inlist* globals; + Ecore_Wl2_Global* global; + Eina_Iterator *globals; if (is_init_) return; - ecore_wl_init(NULL); + if (!ecore_wl2_init()) { + LOGE("could not wl2 init"); + return; + } - registry = ecore_wl_registry_get(); - globals = ecore_wl_globals_get(); + ecore_wl2_display_connect(NULL); + registry = ecore_wl2_display_registry_get(ecore_wl2_connected_display_get(NULL)); + globals = ecore_wl2_display_globals_get(ecore_wl2_connected_display_get(NULL)); if (!registry || !globals) { LOGE("could not get registry(%p) or global list(%p)", - registry, globals); - ecore_wl_shutdown(); + registry, globals); + + LOGE("disconnect wl2_display"); + ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); + ecore_wl2_shutdown(); return; } - EINA_INLIST_FOREACH(globals, global) { + EINA_ITERATOR_FOREACH(globals, global) { if (!strcmp(global->interface, "tizen_remote_surface_manager")) { rsm_ = (struct tizen_remote_surface_manager*)wl_registry_bind(registry, - global->id, &tizen_remote_surface_manager_interface, - global->version < 5 ? global->version : 5); + global->id, &tizen_remote_surface_manager_interface, + global->version < 5 ? global->version : 5); } } if (!rsm_) { LOGE("could not get remote surface manager"); - ecore_wl_shutdown(); + LOGE("disconnect wl2_display"); + ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); + ecore_wl2_shutdown(); return; } tbm_client_ = (struct wayland_tbm_client*)wayland_tbm_client_init( - ecore_wl_display_get()); + ecore_wl2_display_get(ecore_wl2_connected_display_get(NULL))); if (!tbm_client_) { LOGE("could not get tbm client"); tizen_remote_surface_manager_destroy(rsm_); rsm_ = nullptr; - ecore_wl_shutdown(); + LOGE("disconnect wl2_display"); + ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); + ecore_wl2_shutdown(); return; } @@ -120,7 +133,9 @@ void RemoteSurfaceManager::Init() { tbm_client_ = nullptr; tizen_remote_surface_manager_destroy(rsm_); rsm_ = nullptr; - ecore_wl_shutdown(); + LOGE("disconnect wl2_display"); + ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); + ecore_wl2_shutdown(); return; } @@ -130,7 +145,7 @@ void RemoteSurfaceManager::Init() { void RemoteSurfaceManager::Bind(const ITRS& trs, const WlSurface& suf) { if (trs.GetHandle() != nullptr) { tizen_remote_surface_manager_bind_surface(rsm_, suf.GetRaw(), - trs.GetHandle()); + trs.GetHandle()); } } diff --git a/screen_connector_remote_surface/remote_surface_manager_internal.h b/screen_connector_remote_surface/remote_surface_manager_internal.h index 0756887..7f02fa9 100644 --- a/screen_connector_remote_surface/remote_surface_manager_internal.h +++ b/screen_connector_remote_surface/remote_surface_manager_internal.h @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include diff --git a/screen_connector_remote_surface_evas/CMakeLists.txt b/screen_connector_remote_surface_evas/CMakeLists.txt index 551ac66..196f73b 100644 --- a/screen_connector_remote_surface_evas/CMakeLists.txt +++ b/screen_connector_remote_surface_evas/CMakeLists.txt @@ -15,7 +15,7 @@ pkg_check_modules(screen_connector_remote_surface_evas REQUIRED wayland-tbm-client elementary wayland-client - ecore-wayland + ecore-wl2 tizen-remote-surface-client ) diff --git a/screen_connector_remote_surface_evas/remote_surface_evas.cc b/screen_connector_remote_surface_evas/remote_surface_evas.cc index 5b52e83..e51c92c 100644 --- a/screen_connector_remote_surface_evas/remote_surface_evas.cc +++ b/screen_connector_remote_surface_evas/remote_surface_evas.cc @@ -15,7 +15,7 @@ */ #include -#include +#include #include @@ -403,7 +403,8 @@ void RemoteSurfaceEvas::Impl::OnMove(const EvasObject& obj, void *eventInfo) { bool RemoteSurfaceEvas::IsVisibleArea() const { int x, y, w, h; - Ecore_Wl_Window *window = NULL; + Ecore_Wl2_Window *window = NULL; + Ecore_Evas *ee; int window_x, window_y, window_w, window_h; int rotation; @@ -412,11 +413,13 @@ bool RemoteSurfaceEvas::IsVisibleArea() const { return false; } - window = elm_win_wl_window_get(impl_->viewer_win_->GetRaw()); - ecore_wl_window_geometry_get(window, &window_x, &window_y, + ee = ecore_evas_ecore_evas_get( + evas_object_evas_get(impl_->viewer_win_->GetRaw())); + window = ecore_evas_wayland2_window_get(ee); + ecore_wl2_window_geometry_get(window, &window_x, &window_y, &window_w, &window_h); evas_object_geometry_get(impl_->img_tbm_->GetRaw(), &x, &y, &w, &h); - rotation = ecore_wl_window_rotation_get(window); + rotation = ecore_wl2_window_rotation_get(window); if (x >= 0 && x < window_w && y >= 0 && y < window_h && (rotation == 0 || rotation == 180)) { @@ -465,13 +468,13 @@ void RemoteSurfaceEvas::OnBufferChanged(int type, std::shared_ptr tbm, : new Image(evas_object_image_filled_add( evas_object_evas_get(impl_->viewer_win_->GetRaw())), impl_.get(), GetInstId(), GetPid(), this)); - Ecore_Wl_Window* wlWin = elm_win_wl_window_get( - impl_->viewer_win_->GetRaw()); - + Ecore_Evas *ee = ecore_evas_ecore_evas_get( + evas_object_evas_get(impl_->viewer_win_->GetRaw())); + Ecore_Wl2_Window* wlWin = ecore_evas_wayland2_window_get(ee); if (!wlWin) LOGE("Failed to get wlWin"); else - impl_->winVisibility_map_[ecore_wl_window_id_get(wlWin)] = UNKNOWN; + impl_->winVisibility_map_[ecore_wl2_window_id_get(wlWin)] = UNKNOWN; isAdded = true; } @@ -499,22 +502,24 @@ void RemoteSurfaceEvas::OnEvasChanged(const std::string& appId, void RemoteSurfaceEvas::Bind(const EvasObject& win) { struct wl_surface* surface; - Ecore_Wl_Window* wl_win; + Ecore_Wl2_Window* wl_win; + Ecore_Evas *ee = ecore_evas_ecore_evas_get( + evas_object_evas_get(win.GetRaw())); int bind_win_id; - wl_win = elm_win_wl_window_get(win.GetRaw()); + wl_win = ecore_evas_wayland2_window_get(ee); if (!wl_win) { LOGE("failed to get wl_win"); return; } - surface = ecore_wl_window_surface_get(wl_win); + surface = ecore_wl2_window_surface_get(wl_win); if (!surface) { LOGE("failed to get surface"); return; } - bind_win_id = ecore_wl_window_id_get(wl_win); + bind_win_id = ecore_wl2_window_id_get(wl_win); impl_->winVisibility_map_[bind_win_id] = UNKNOWN; impl_->bind_win_id_ = bind_win_id; @@ -560,8 +565,8 @@ void RemoteSurfaceEvas::NotifyWindowVisibilityEvent(int type, void* event) { if (!IsVisibleArea()) return; - Ecore_Wl_Event_Window_Visibility_Change* ev = - static_cast(event); + Ecore_Wl2_Event_Window_Visibility_Change* ev = + static_cast(event); Visibility v; if (ev->fully_obscured) diff --git a/screen_connector_remote_surface_evas/remote_surface_mixed.cc b/screen_connector_remote_surface_evas/remote_surface_mixed.cc index dba33ad..24df22b 100644 --- a/screen_connector_remote_surface_evas/remote_surface_mixed.cc +++ b/screen_connector_remote_surface_evas/remote_surface_mixed.cc @@ -15,7 +15,7 @@ */ #include -#include +#include #include diff --git a/screen_connector_remote_surface_evas/remote_surface_watcher.cc b/screen_connector_remote_surface_evas/remote_surface_watcher.cc index 675a539..7c5d3cb 100644 --- a/screen_connector_remote_surface_evas/remote_surface_watcher.cc +++ b/screen_connector_remote_surface_evas/remote_surface_watcher.cc @@ -15,7 +15,7 @@ */ #include -#include +#include #include diff --git a/screen_connector_watcher/CMakeLists.txt b/screen_connector_watcher/CMakeLists.txt index 5a78fdd..3d9a027 100644 --- a/screen_connector_watcher/CMakeLists.txt +++ b/screen_connector_watcher/CMakeLists.txt @@ -15,7 +15,7 @@ pkg_check_modules(screen_connector_watcher REQUIRED wayland-tbm-client elementary wayland-client - ecore-wayland + ecore-wl2 tizen-remote-surface-client ) diff --git a/screen_connector_watcher/src/screen_connector_toolkit.cc b/screen_connector_watcher/src/screen_connector_toolkit.cc index a60e327..5a7b715 100644 --- a/screen_connector_watcher/src/screen_connector_toolkit.cc +++ b/screen_connector_watcher/src/screen_connector_toolkit.cc @@ -19,8 +19,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc index ff8f1d8..5ff61b9 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -203,7 +203,7 @@ screen_connector_toolkit_evas_start_visibility_notify(void) { return -1; __visibilityListener = ecore_event_handler_add( - ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE, [](void* data, int type, + ECORE_WL2_EVENT_WINDOW_VISIBILITY_CHANGE, [](void* data, int type, void* event)->Eina_Bool { for (int i = SCREEN_CONNECTOR_SCREEN_TYPE_WIDGET; i <= SCREEN_CONNECTOR_SCREEN_TYPE_ALL; i++) { diff --git a/screen_connector_watcher_evas/src/screen_connector_watcher_evas.cc b/screen_connector_watcher_evas/src/screen_connector_watcher_evas.cc index 2c6e79a..91020af 100644 --- a/screen_connector_watcher_evas/src/screen_connector_watcher_evas.cc +++ b/screen_connector_watcher_evas/src/screen_connector_watcher_evas.cc @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include -- 2.7.4 From bb20fd1a865f233b6d49e965c908d6a375317bd5 Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 19 Mar 2018 15:55:05 +0900 Subject: [PATCH 07/16] Release version 1.3.4 Changes: - EFL_UPGRADE: remove ecore-wayland dependency Change-Id: I85c447da333adbd7296b6636a5fd754dc6aacbe7 Signed-off-by: hyunho --- packaging/libscreen_connector.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscreen_connector.spec b/packaging/libscreen_connector.spec index d0fef92..2e35a7e 100644 --- a/packaging/libscreen_connector.spec +++ b/packaging/libscreen_connector.spec @@ -1,6 +1,6 @@ Name: libscreen_connector Summary: Library for developing the application -Version: 1.3.3 +Version: 1.3.4 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 4a7d8aa71a08a0b9169afdc85325ed0abadb0c45 Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 2 Apr 2018 19:23:48 +0900 Subject: [PATCH 08/16] Fix memory leak Change-Id: Ife61f65f347d91890635c9a38445509545ac2ae8 Signed-off-by: hyunho --- screen_connector_provider/src/screen_connector_provider.c | 6 +++++- screen_connector_remote_surface/remote_surface_manager.cc | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/screen_connector_provider/src/screen_connector_provider.c b/screen_connector_provider/src/screen_connector_provider.c index 671ef5a..24add27 100755 --- a/screen_connector_provider/src/screen_connector_provider.c +++ b/screen_connector_provider/src/screen_connector_provider.c @@ -194,7 +194,8 @@ EXPORT_API int screen_connector_provider_set_event_filter(screen_connector_provi return 0; } -static void __shutdown_ecore_wl2_display() { +static void __shutdown_ecore_wl2_display() +{ LOGE("disconnect wl2_display"); ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); ecore_wl2_shutdown(); @@ -226,6 +227,7 @@ EXPORT_API int screen_connector_provider_init(void) LOGE("could not get registry(%p) or global list(%p)", registry, globals); __shutdown_ecore_wl2_display(); + eina_iterator_free(globals); return -1; } @@ -240,8 +242,10 @@ EXPORT_API int screen_connector_provider_init(void) if (!__rsm) { LOGE("could not get remote surface manager"); __shutdown_ecore_wl2_display(); + eina_iterator_free(globals); return -1; } + eina_iterator_free(globals); __init_count++; return 0; diff --git a/screen_connector_remote_surface/remote_surface_manager.cc b/screen_connector_remote_surface/remote_surface_manager.cc index eb92a67..442c670 100644 --- a/screen_connector_remote_surface/remote_surface_manager.cc +++ b/screen_connector_remote_surface/remote_surface_manager.cc @@ -111,6 +111,7 @@ void RemoteSurfaceManager::Init() { LOGE("disconnect wl2_display"); ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); ecore_wl2_shutdown(); + eina_iterator_free(globals); return; } @@ -123,6 +124,7 @@ void RemoteSurfaceManager::Init() { LOGE("disconnect wl2_display"); ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); ecore_wl2_shutdown(); + eina_iterator_free(globals); return; } @@ -136,9 +138,10 @@ void RemoteSurfaceManager::Init() { LOGE("disconnect wl2_display"); ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); ecore_wl2_shutdown(); + eina_iterator_free(globals); return; } - + eina_iterator_free(globals); is_init_ = true; } -- 2.7.4 From 2972d4234a96fffc607fe8bcb9e75e0672b04c00 Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 2 Apr 2018 19:27:48 +0900 Subject: [PATCH 09/16] Add exception handler for unittest Change-Id: Id77b313c570198bc1fef7285fe4e54ff977d4f22 Signed-off-by: hyunho --- unittest/src/sc_test_main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/unittest/src/sc_test_main.cpp b/unittest/src/sc_test_main.cpp index 14fe324..9ce9595 100644 --- a/unittest/src/sc_test_main.cpp +++ b/unittest/src/sc_test_main.cpp @@ -2,10 +2,18 @@ #include int main(int argc, char** argv){ + int ret = -1; try { testing::InitGoogleTest(&argc, argv); } catch(...) { std::cout << "Exception occurred" << std::endl; } - return RUN_ALL_TESTS(); + try { + ret = RUN_ALL_TESTS(); + } catch (const ::testing::internal::GoogleTestFailureException& e) { + ret = -1; + std::cout << "GoogleTestFailureException was thrown:" << e.what() << std::endl; + } + + return ret; } -- 2.7.4 From 534f8f09e7d97632ffdeeacfdc1720d002edec0a Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 3 Apr 2018 13:09:16 +0900 Subject: [PATCH 10/16] Release version 1.3.5 Changes: - Fix memory leak - Add exception handler for unittest Change-Id: Icbd8232957bce4587f9b4aba41a057bd3e7011fa Signed-off-by: hyunho --- packaging/libscreen_connector.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscreen_connector.spec b/packaging/libscreen_connector.spec index 2e35a7e..5846c15 100644 --- a/packaging/libscreen_connector.spec +++ b/packaging/libscreen_connector.spec @@ -1,6 +1,6 @@ Name: libscreen_connector Summary: Library for developing the application -Version: 1.3.4 +Version: 1.3.5 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 561280ba66234a3d00535637554c3c8b38c16b00 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Tue, 3 Apr 2018 16:42:06 +0900 Subject: [PATCH 11/16] Fix a bug about releasing handle - The handle should be freed in the function Change-Id: Ia8393ce8e09281c823715364b705c1f91e501bd5 Signed-off-by: Junghoon Park --- .../src/screen_connector_toolkit_evas.cc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc index 5ff61b9..764f1fa 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc @@ -178,21 +178,17 @@ screen_connector_toolkit_evas_add(screen_connector_toolkit_evas_ops* ops, extern "C" EXPORT_API int screen_connector_toolkit_evas_remove(screen_connector_toolkit_evas_h handle) { - g_idle_add([](gpointer user_data)->gboolean { - RemoteSurfaceEvasStub* rs = static_cast(user_data); + RemoteSurfaceEvasStub* rs = static_cast(handle); - for (int i = SCREEN_CONNECTOR_SCREEN_TYPE_WIDGET; - i <= SCREEN_CONNECTOR_SCREEN_TYPE_ALL; i++) { - auto sci = __connectors.find(i); + for (int i = SCREEN_CONNECTOR_SCREEN_TYPE_WIDGET; + i <= SCREEN_CONNECTOR_SCREEN_TYPE_ALL; i++) { + auto sci = __connectors.find(i); - if (sci == __connectors.end()) - continue; + if (sci == __connectors.end()) + continue; - __connectors[i]->Remove(rs); - } - - return G_SOURCE_REMOVE; - }, handle); + __connectors[i]->Remove(rs); + } return 0; } -- 2.7.4 From b21aba6d98dbb6bb4f4fffb6b6860c569f8c70a6 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Tue, 3 Apr 2018 19:05:08 +0900 Subject: [PATCH 12/16] Release version 1.3.6 Changes: - Fix a bug about releasing handle Change-Id: I534ae1374f5db489d37c8603676a6ddb5a5976ea Signed-off-by: Junghoon Park --- packaging/libscreen_connector.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscreen_connector.spec b/packaging/libscreen_connector.spec index 5846c15..8630fbd 100644 --- a/packaging/libscreen_connector.spec +++ b/packaging/libscreen_connector.spec @@ -1,6 +1,6 @@ Name: libscreen_connector Summary: Library for developing the application -Version: 1.3.5 +Version: 1.3.6 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 844bce0ba017c915cdd8648f2c8e06f1cae615cc Mon Sep 17 00:00:00 2001 From: Semun Lee Date: Wed, 11 Apr 2018 14:48:49 +0900 Subject: [PATCH 13/16] Fix resource leak Change-Id: Ib301a9a95377ce11f697e4893c7f2ec76be5d74b Signed-off-by: Semun Lee --- screen_connector_remote_surface/remote_surface_manager.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/screen_connector_remote_surface/remote_surface_manager.cc b/screen_connector_remote_surface/remote_surface_manager.cc index 442c670..3d6afd5 100644 --- a/screen_connector_remote_surface/remote_surface_manager.cc +++ b/screen_connector_remote_surface/remote_surface_manager.cc @@ -95,6 +95,8 @@ void RemoteSurfaceManager::Init() { LOGE("disconnect wl2_display"); ecore_wl2_display_disconnect(ecore_wl2_connected_display_get(NULL)); ecore_wl2_shutdown(); + if (globals) + eina_iterator_free(globals); return; } -- 2.7.4 From 0eba3133b6f829b3f3cedbb554a72b621bf20c35 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 24 Apr 2018 11:24:05 +0900 Subject: [PATCH 14/16] Release version 1.3.7 Changes: - Fix resource leak Change-Id: I862ecfba15fb4c2259c9aba0faabb6dc82a04719 Signed-off-by: Hwankyu Jhun --- packaging/libscreen_connector.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libscreen_connector.spec b/packaging/libscreen_connector.spec index 8630fbd..d112bd3 100644 --- a/packaging/libscreen_connector.spec +++ b/packaging/libscreen_connector.spec @@ -1,6 +1,6 @@ Name: libscreen_connector Summary: Library for developing the application -Version: 1.3.6 +Version: 1.3.7 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 26f6f4da22b4ebc11ebab8f4bfcf094eb92cba6a Mon Sep 17 00:00:00 2001 From: Semun Lee Date: Wed, 9 May 2018 15:25:16 +0900 Subject: [PATCH 15/16] Fix errata Change-Id: I13d7b90f87b0afca9e5c0bb3c6779f3b2fb03c7c Signed-off-by: Semun Lee --- screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc index 764f1fa..06694d9 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc @@ -113,7 +113,7 @@ class Connector { } } - void NotifyWidnowVisibilityEvent(int type, void* event) { + void NotifyWindowVisibilityEvent(int type, void* event) { for (auto& rs : surfaces_) { rs->NotifyWindowVisibilityEvent(type, event); } @@ -208,7 +208,7 @@ screen_connector_toolkit_evas_start_visibility_notify(void) { if (sci == __connectors.end()) continue; - __connectors[i]->NotifyWidnowVisibilityEvent(type, event); + __connectors[i]->NotifyWindowVisibilityEvent(type, event); } return ECORE_CALLBACK_RENEW; -- 2.7.4 From 8ad51350f650372d274dc2de7afdccfb0d8f3fbe Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Thu, 10 May 2018 10:46:41 +0900 Subject: [PATCH 16/16] Add API for fixing buffer release issue Change-Id: I5e37db25bb21529d28e465a5d51951e4e6587f1c Signed-off-by: Junghoon Park --- .../include/screen_connector_toolkit.h | 2 ++ .../src/screen_connector_toolkit.cc | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/screen_connector_watcher/include/screen_connector_toolkit.h b/screen_connector_watcher/include/screen_connector_toolkit.h index 9fe4f77..0da2c44 100644 --- a/screen_connector_watcher/include/screen_connector_toolkit.h +++ b/screen_connector_watcher/include/screen_connector_toolkit.h @@ -105,6 +105,8 @@ bool screen_connector_toolkit_is_exist(const char* id, int screen_connector_toolkit_set_changed_event_filter( screen_connector_toolkit_h h, screen_connector_changed_event_filter_type type); +int screen_connector_toolkit_dispose_buffer(screen_connector_toolkit_h handle, + const struct wl_buffer* tbm); #ifdef __cplusplus } diff --git a/screen_connector_watcher/src/screen_connector_toolkit.cc b/screen_connector_watcher/src/screen_connector_toolkit.cc index 5a7b715..4b63845 100644 --- a/screen_connector_watcher/src/screen_connector_toolkit.cc +++ b/screen_connector_watcher/src/screen_connector_toolkit.cc @@ -87,12 +87,23 @@ class RemoteSurfaceToolkit : public screen_connector::RemoteSurface { screen_connector::RemoteSurface::GetAppId().c_str(), screen_connector::RemoteSurface::GetInstId().c_str(), screen_connector::RemoteSurface::GetPid(), data_); + prev_tbms_.push_back(std::move(tbm)); + } + } + + void DisposeBuffer(const struct wl_buffer* tbm) { + for (auto& i : prev_tbms_) { + if (i->GetRaw() == tbm) { + prev_tbms_.remove(i); + return; + } } } private: screen_connector_toolkit_ops ops_; void* data_; + std::list> prev_tbms_; }; class Toolkit { @@ -301,3 +312,11 @@ screen_connector_toolkit_set_changed_event_filter( (screen_connector::RemoteSurface::ChangedEventFilter)type); return 0; } + +extern "C" EXPORT_API int +screen_connector_toolkit_dispose_buffer(screen_connector_toolkit_h handle, + const struct wl_buffer* tbm) { + RemoteSurfaceToolkit* rs = static_cast(handle); + rs->DisposeBuffer(tbm); + return 0; +} -- 2.7.4