From 2972d4234a96fffc607fe8bcb9e75e0672b04c00 Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 2 Apr 2018 19:27:48 +0900 Subject: [PATCH 01/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 02/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 03/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 04/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 05/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 06/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 07/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 08/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 From 47a0248f570d021e308eecd25d69d6252c6c7728 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Thu, 10 May 2018 15:20:14 +0900 Subject: [PATCH 09/16] Release version 1.3.8 Changes: - Add API for fixing buffer release issue - Fix errata Change-Id: Icbb847026847db08d6d30b915a42cc5801dc2149 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 d112bd3..947f11e 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.7 +Version: 1.3.8 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 2747db6f0c3929e2f57ec9c49401b1fc98e749f7 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 5 Jun 2018 15:05:46 +0900 Subject: [PATCH 10/16] Monitor visibility status of viewer windows To use visibilty status of viewer window, screen connector monitors ecore events. Change-Id: I8604b47e38bba1a1167ae5e95e10b51674c7acac Signed-off-by: Hwankyu Jhun --- .../ecore_event_handler_internal.h | 105 +++++++++++++++++++++ screen_connector_remote_surface/window_context.cc | 72 ++++++++++++++ screen_connector_remote_surface/window_context.h | 65 +++++++++++++ .../remote_surface_evas.cc | 29 ++++-- .../remote_surface_evas.h | 5 + 5 files changed, 270 insertions(+), 6 deletions(-) create mode 100644 screen_connector_remote_surface/ecore_event_handler_internal.h create mode 100644 screen_connector_remote_surface/window_context.cc create mode 100644 screen_connector_remote_surface/window_context.h diff --git a/screen_connector_remote_surface/ecore_event_handler_internal.h b/screen_connector_remote_surface/ecore_event_handler_internal.h new file mode 100644 index 0000000..dff7a03 --- /dev/null +++ b/screen_connector_remote_surface/ecore_event_handler_internal.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SCREEN_CONNECTOR_ECORE_EVENT_HANDLER_INTERNAL_H_ +#define SCREEN_CONNECTOR_ECORE_EVENT_HANDLER_INTERNAL_H_ + +#include + +#include +#include + +#include "screen_connector_remote_surface/common.h" + +namespace screen_connector { + +class EcoreEventHandler { + public: + class IEventListener { + public: + virtual void OnWindowShow(unsigned int win) = 0; + virtual void OnWindowHide(unsigned int win) = 0; + virtual void OnWindowVisibilityChange(unsigned int win, + bool fully_obscured) = 0; + virtual void OnWindowPreVisibilityChange(unsigned int win, + bool fully_obscured) = 0; + }; + + explicit EcoreEventHandler(IEventListener* listener) : listener_(listener) { + show_ = ecore_event_handler_add( + ECORE_WL2_EVENT_WINDOW_SHOW, + EcoreEventCB, listener_); + hide_ = ecore_event_handler_add( + ECORE_WL2_EVENT_WINDOW_HIDE, + EcoreEventCB, listener_); + visibility_change_ = ecore_event_handler_add( + ECORE_WL2_EVENT_WINDOW_VISIBILITY_CHANGE, + EcoreEventCB, listener_); + pre_visibility_change_ = ecore_event_handler_add( + ECORE_WL2_EVENT_WINDOW_PRE_VISIBILITY_CHANGE, + EcoreEventCB, listener_); + } + + virtual ~EcoreEventHandler() { + if (pre_visibility_change_) + ecore_event_handler_del(pre_visibility_change_); + if (visibility_change_) + ecore_event_handler_del(visibility_change_); + if (hide_) + ecore_event_handler_del(hide_); + if (show_) + ecore_event_handler_del(show_); + } + + private: + static Eina_Bool EcoreEventCB(void* data, int type, void* event) { + IEventListener* rs = static_cast(data); + + if (type == ECORE_WL2_EVENT_WINDOW_SHOW) { + Ecore_Wl2_Event_Window_Show* ev = + static_cast(event); + rs->OnWindowShow(ev->win); + } else if (type == ECORE_WL2_EVENT_WINDOW_HIDE) { + Ecore_Wl2_Event_Window_Hide* ev = + static_cast(event); + rs->OnWindowHide(ev->win); + } else if (type == ECORE_WL2_EVENT_WINDOW_VISIBILITY_CHANGE) { + Ecore_Wl2_Event_Window_Visibility_Change* ev = + static_cast(event); + rs->OnWindowVisibilityChange(ev->win, ev->fully_obscured); + } else if (type == ECORE_WL2_EVENT_WINDOW_PRE_VISIBILITY_CHANGE) { + Ecore_Wl2_Event_Window_Pre_Visibility_Change* ev = + static_cast(event); + if (ev->type == ECORE_WL2_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED) { + rs->OnWindowPreVisibilityChange(ev->win, false); + } else if (ev->type == ECORE_WL2_WINDOW_VISIBILITY_TYPE_FULLY_OBSCURED) { + rs->OnWindowPreVisibilityChange(ev->win, true); + } + } + return ECORE_CALLBACK_RENEW; + } + + private: + IEventListener* listener_; + Ecore_Event_Handler* show_ = nullptr; + Ecore_Event_Handler* hide_ = nullptr; + Ecore_Event_Handler* visibility_change_ = nullptr; + Ecore_Event_Handler* pre_visibility_change_ = nullptr; +}; + +} // namespace screen_connector + +#endif // SCREEN_CONNECTOR_ECORE_EVENT_HANDLER_INTERNAL_H_ diff --git a/screen_connector_remote_surface/window_context.cc b/screen_connector_remote_surface/window_context.cc new file mode 100644 index 0000000..bff8a09 --- /dev/null +++ b/screen_connector_remote_surface/window_context.cc @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include +#include + +#include "screen_connector_remote_surface/window_context.h" +#include "screen_connector_remote_surface/common.h" + +#ifdef LOG_TAG +#undef LOG_TAG +#endif + +#define LOG_TAG "SC_WINDOW_CONTEXT" + +namespace screen_connector { + +WindowContext::WindowContext() : + ecore_event_handler_(new EcoreEventHandler(this)) { +} + +void WindowContext::UpdateWindow(unsigned int win, bool fully_obscured) { + win_map_[win] = fully_obscured; +} + +void WindowContext::RemoveWindow(unsigned int win) { + if (win_map_.find(win) == win_map_.end()) + return; + win_map_.erase(win); +} + +void WindowContext::OnWindowShow(unsigned int win) { + UpdateWindow(win, false); + LOGD("[__WINDOW_SHOW__] win(%u)", win); +} + +void WindowContext::OnWindowHide(unsigned int win) { + RemoveWindow(win); + LOGD("[__WINDOW_HIDE__] win(%u)", win); +} + +void WindowContext::OnWindowVisibilityChange(unsigned int win, + bool fully_obscured) { + UpdateWindow(win, fully_obscured); + LOGD("[__WINDOW_VISIBILITY_CHANGE__] win(%u), fully_obscured(%d)", + win, fully_obscured); +} + +void WindowContext::OnWindowPreVisibilityChange(unsigned int win, + bool fully_obscured) { + UpdateWindow(win, fully_obscured); + LOGD("[__WINDOW_PRE_VISIBILITY_CHANGE__] win(%u), fully_obscured(%d)", + win, fully_obscured); +} + +} // namespace screen_connector diff --git a/screen_connector_remote_surface/window_context.h b/screen_connector_remote_surface/window_context.h new file mode 100644 index 0000000..e6a2bac --- /dev/null +++ b/screen_connector_remote_surface/window_context.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SCREEN_CONNECTOR_WINDOW_CONTEXT_H_ +#define SCREEN_CONNECTOR_WINDOW_CONTEXT_H_ + +#include +#include +#include + +#include "screen_connector_remote_surface/ecore_event_handler_internal.h" +#include "screen_connector_remote_surface/common.h" + +namespace screen_connector { + +class EXPORT_API WindowContext : public EcoreEventHandler::IEventListener { + public: + WindowContext(); + virtual ~WindowContext() = default; + + bool IsFullyObscured(unsigned int win) { + if (win_map_.find(win) == win_map_.end()) + return false; + return win_map_[win]; + } + + unsigned int FindWindow(unsigned int win) { + if (win_map_.find(win) == win_map_.end()) + return 0; + return win; + } + + private: + void OnWindowShow(unsigned int win) override; + void OnWindowHide(unsigned int win) override; + void OnWindowVisibilityChange(unsigned int win, + bool fully_obscured) override; + void OnWindowPreVisibilityChange(unsigned int win, + bool fully_obscured) override; + + private: + void UpdateWindow(unsigned int win, bool fully_obscured); + void RemoveWindow(unsigned int win); + + private: + std::unique_ptr ecore_event_handler_; + std::map win_map_; +}; + +} // namespace screen_connector + +#endif // SCREEN_CONNECTOR_WINDOW_CONTEXT_H_ diff --git a/screen_connector_remote_surface_evas/remote_surface_evas.cc b/screen_connector_remote_surface_evas/remote_surface_evas.cc index e51c92c..56edaaa 100644 --- a/screen_connector_remote_surface_evas/remote_surface_evas.cc +++ b/screen_connector_remote_surface_evas/remote_surface_evas.cc @@ -37,7 +37,8 @@ RemoteSurfaceEvas::RemoteSurfaceEvas(const std::string& id, std::shared_ptr viewerWin, bool mock) : RemoteSurface(id, type, mock), - impl_(new Impl(this, viewerWin, mock)) { + impl_(new Impl(this, viewerWin, mock)), + win_ctx_(new WindowContext()) { } RemoteSurfaceEvas::RemoteSurfaceEvas(int rid, const std::string& id, @@ -45,7 +46,8 @@ RemoteSurfaceEvas::RemoteSurfaceEvas(int rid, const std::string& id, std::shared_ptr viewerWin, bool mock) : RemoteSurface(rid, id, type, mock), - impl_(new Impl(this, viewerWin, mock)) { + impl_(new Impl(this, viewerWin, mock)), + win_ctx_(new WindowContext()) { } RemoteSurfaceEvas::~RemoteSurfaceEvas() = default; @@ -471,10 +473,12 @@ void RemoteSurfaceEvas::OnBufferChanged(int type, std::shared_ptr tbm, 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) + if (!wlWin) { LOGE("Failed to get wlWin"); - else - impl_->winVisibility_map_[ecore_wl2_window_id_get(wlWin)] = UNKNOWN; + } else { + unsigned int win_id = ecore_wl2_window_id_get(wlWin); + impl_->winVisibility_map_[win_id] = GetVisibility(win_id); + } isAdded = true; } @@ -520,7 +524,7 @@ void RemoteSurfaceEvas::Bind(const EvasObject& win) { } bind_win_id = ecore_wl2_window_id_get(wl_win); - impl_->winVisibility_map_[bind_win_id] = UNKNOWN; + impl_->winVisibility_map_[bind_win_id] = GetVisibility(bind_win_id); impl_->bind_win_id_ = bind_win_id; RemoteSurface::Bind(std::shared_ptr( @@ -598,4 +602,17 @@ RemoteSurfaceEvas::Visibility RemoteSurfaceEvas::GetVisibility() const { return impl_->visibility_; } +RemoteSurfaceEvas::Visibility RemoteSurfaceEvas::GetVisibility( + unsigned int win) { + if (!win_ctx_->FindWindow(win)) { + LOGE("Failed to find window(%u)", win); + return RemoteSurfaceEvas::UNKNOWN; + } + + if (win_ctx_->IsFullyObscured(win)) + return RemoteSurfaceEvas::FULLY_OBSCURED; + + return RemoteSurfaceEvas::UNOBSCURED; +} + } // namespace screen_connector diff --git a/screen_connector_remote_surface_evas/remote_surface_evas.h b/screen_connector_remote_surface_evas/remote_surface_evas.h index 14f2f75..55acd13 100644 --- a/screen_connector_remote_surface_evas/remote_surface_evas.h +++ b/screen_connector_remote_surface_evas/remote_surface_evas.h @@ -24,6 +24,7 @@ #include "screen_connector_remote_surface_evas/evas_object.h" #include "screen_connector_remote_surface_evas/evas_event_interface.h" #include "screen_connector_remote_surface/remote_surface.h" +#include "screen_connector_remote_surface/window_context.h" namespace screen_connector { @@ -69,8 +70,12 @@ class EXPORT_API RemoteSurfaceEvas : public RemoteSurface, public IEvasEvent { int pid, const EvasObject& image) override; private: + Visibility GetVisibility(unsigned int win); + + private: class Impl; std::unique_ptr impl_; + std::unique_ptr win_ctx_; }; } // namespace screen_connector -- 2.7.4 From 4e4cdea930a08f8b7079c8cab520830d8137df26 Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 7 Jun 2018 16:14:06 +0900 Subject: [PATCH 11/16] Release version 1.3.9 Changes: - Monitor visibility status of viewer windows Change-Id: I28d2a470e84a13dbea59160f3e04d9512b617b60 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 947f11e..6fcbd8b 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.8 +Version: 1.3.9 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From a2762c7737fbb1062e2bd80ab4ebf1f38589878a Mon Sep 17 00:00:00 2001 From: Lukasz Wlazly Date: Mon, 11 Jun 2018 09:25:36 +0200 Subject: [PATCH 12/16] Fix invalid plug ID Invalid version of this property was causing errors during communication over DBus. Change-Id: I1cabe34842a940760e89939618d80888acceb284 --- screen_connector_remote_surface_evas/image.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screen_connector_remote_surface_evas/image.cc b/screen_connector_remote_surface_evas/image.cc index 098b0a8..df4558a 100644 --- a/screen_connector_remote_surface_evas/image.cc +++ b/screen_connector_remote_surface_evas/image.cc @@ -53,7 +53,7 @@ Image::Image(Evas_Object* raw, IEventListener* listener, /* Set data to use in accessibility */ std::string plugId = instId + ":"; - plugId += pid; + plugId += std::to_string(pid); evas_object_data_set(GetRaw(), "___PLUGID", strdup(plugId.c_str())); evas_object_data_set(GetRaw(), SC_TOOLKIT_HANDLE_TAG, tag); } -- 2.7.4 From 34b94968de1aa65eef8f5236cba026154dd9e420 Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 14 Jun 2018 13:36:56 +0900 Subject: [PATCH 13/16] Release version 1.3.10 Changes: - Fix invalid plug ID Change-Id: Id37d5fe9ad5a0eba0984cc966f19076999fd5667 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 6fcbd8b..b1106c2 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.9 +Version: 1.3.10 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 29a70c7ae58ec489a15b322653840c462a44a6a4 Mon Sep 17 00:00:00 2001 From: hyunho Date: Fri, 20 Jul 2018 14:44:08 +0900 Subject: [PATCH 14/16] Check window visibility when sends unobscured event to watch Change-Id: I19b468859d9bbccee96fa06916c8b5cabe9ee3fe Signed-off-by: hyunho --- screen_connector_remote_surface_evas/remote_surface_evas.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/screen_connector_remote_surface_evas/remote_surface_evas.cc b/screen_connector_remote_surface_evas/remote_surface_evas.cc index 56edaaa..4cd5f5f 100644 --- a/screen_connector_remote_surface_evas/remote_surface_evas.cc +++ b/screen_connector_remote_surface_evas/remote_surface_evas.cc @@ -394,7 +394,14 @@ void RemoteSurfaceEvas::Impl::OnMove(const EvasObject& obj, void *eventInfo) { return; } - if (parent_->IsVisibleArea()) { + Ecore_Wl2_Window *window = NULL; + Ecore_Evas *ee; + ee = ecore_evas_ecore_evas_get( + evas_object_evas_get(viewer_win_->GetRaw())); + window = ecore_evas_wayland2_window_get(ee); + + unsigned int win_id = ecore_wl2_window_id_get(window); + if (parent_->IsVisibleArea() && winVisibility_map_[win_id] == UNOBSCURED) { parent_->SendVisibility(true); visibility_ = RemoteSurfaceEvas::UNOBSCURED; } else { -- 2.7.4 From 286cef49b2100a6502fe3bbd4341dd6c493852c9 Mon Sep 17 00:00:00 2001 From: hyunho Date: Fri, 27 Jul 2018 10:39:39 +0900 Subject: [PATCH 15/16] Release version 1.3.11 Changes: - Check window visibility when sends unobscured event to watch Change-Id: Iabe5093c9da2460a86553e0b1c8baa0f8d6299e4 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 b1106c2..36c56ed 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.10 +Version: 1.3.11 Release: 1 Group: Applications/Core Applications License: Apache-2.0 -- 2.7.4 From 3210746d6f342f41a505ec01375c727fa4dd60af Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 20 Aug 2018 09:39:24 +0900 Subject: [PATCH 16/16] Removes unnecessarily included header files Change-Id: I83e6f94419b62fa9d76d65e2f69966266129bca5 Signed-off-by: hyunho --- screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h | 2 -- screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h b/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h index 7d4bd52..e963c6a 100644 --- a/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h +++ b/screen_connector_watcher_evas/include/screen_connector_toolkit_evas.h @@ -20,8 +20,6 @@ #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 06694d9..0ad65ee 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.cc @@ -26,6 +26,9 @@ #include #include #include +#include +#include + #include #include #include -- 2.7.4