From ad7b390342193d2b654567e7e82890de0691d5f8 Mon Sep 17 00:00:00 2001 From: Woochan Lee Date: Thu, 17 Mar 2016 11:32:08 +0900 Subject: [PATCH] Event blocking during view tansition effect showing. Change-Id: I27244556863bb3f8baf12462b13726bdb94ee65a --- src/include/efl/mobile/ui_basic_view.h | 1 + src/include/efl/ui_view.h | 8 ++++++++ src/lib/efl/mobile/ui_basic_view.cpp | 5 +++++ src/lib/interface/ui_iface_viewmgr.cpp | 5 +++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/include/efl/mobile/ui_basic_view.h b/src/include/efl/mobile/ui_basic_view.h index 297efb1..8b944bd 100644 --- a/src/include/efl/mobile/ui_basic_view.h +++ b/src/include/efl/mobile/ui_basic_view.h @@ -34,6 +34,7 @@ protected: virtual void load(); virtual void unload(); virtual void unload_content(); + virtual void set_event_block(bool block); public: ui_basic_view(ui_controller *controller, const char *name = NULL); diff --git a/src/include/efl/ui_view.h b/src/include/efl/ui_view.h index dff9273..f9349e7 100644 --- a/src/include/efl/ui_view.h +++ b/src/include/efl/ui_view.h @@ -84,6 +84,14 @@ protected: * @return base layout of viewmgr. */ Evas_Object *get_parent(); + + /** @brief toggle event block. + * + * @note It makes internal conformant event freeze during effect showing. + * + * @param block @c true, when blocking is enabled, otherwise @c false. + */ + virtual void set_event_block(bool block) {} }; } diff --git a/src/lib/efl/mobile/ui_basic_view.cpp b/src/lib/efl/mobile/ui_basic_view.cpp index 3d8f93b..04c55fd 100644 --- a/src/lib/efl/mobile/ui_basic_view.cpp +++ b/src/lib/efl/mobile/ui_basic_view.cpp @@ -264,3 +264,8 @@ void ui_basic_view::menu() if (!this->get_controller()) return; (dynamic_cast(this->get_controller()))->menu(); } + +void ui_basic_view::set_event_block(bool block) +{ + evas_object_freeze_events_set(this->get_base(), block); +} diff --git a/src/lib/interface/ui_iface_viewmgr.cpp b/src/lib/interface/ui_iface_viewmgr.cpp index 3cdfd77..5df0e2e 100644 --- a/src/lib/interface/ui_iface_viewmgr.cpp +++ b/src/lib/interface/ui_iface_viewmgr.cpp @@ -52,7 +52,6 @@ bool ui_iface_viewmgr::disconnect_view(ui_iface_view *view) void ui_iface_viewmgr::set_event_block(ui_iface_view *view, bool block) { - if (!ui_iface_viewmgr::event_block) return; view->set_event_block(block); } @@ -149,7 +148,9 @@ ui_iface_viewmgr::push_view(ui_iface_view *view) } view->inactive(); - this->set_event_block(view, true); + + //FIXME: First view has no effect? + if (this->view_list.size() != 1) this->set_event_block(view, true); return view; } -- 2.7.4