X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyinput-focus-manager-impl.cpp;h=6b95600410a112a28bc5e2e9b3cd17f73b3a0154;hb=81529cb3b54f998306def4db0ba3f5f5a65c0c30;hp=f188281f955e39232271d3390b2d47d1927443f4;hpb=14d7745ee5464be56aaff3843c592b9bf45820f8;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp b/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp index f188281..6b95600 100644 --- a/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp +++ b/dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -23,10 +23,10 @@ #include #include #include - -// INTERNAL INCLUDES #include #include +#include +#include namespace Dali { @@ -50,13 +50,26 @@ KeyInputFocusManager::KeyInputFocusManager() : mSlotDelegate( this ), mCurrentFocusControl() { - DevelStage::KeyEventGeneratedSignal( Stage::GetCurrent() ).Connect(mSlotDelegate, &KeyInputFocusManager::OnKeyEvent); + // Retrieve all the existing widnows + Dali::SceneHolderList sceneHolders = Adaptor::Get().GetSceneHolders(); + for( auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter ) + { + ( *iter ).KeyEventGeneratedSignal().Connect( mSlotDelegate, &KeyInputFocusManager::OnKeyEvent ); + } + + // Get notified when any new scene holder is created afterwards + Adaptor::Get().WindowCreatedSignal().Connect( mSlotDelegate, &KeyInputFocusManager::OnSceneHolderCreated ); } KeyInputFocusManager::~KeyInputFocusManager() { } +void KeyInputFocusManager::OnSceneHolderCreated( Dali::Integration::SceneHolder& sceneHolder ) +{ + sceneHolder.KeyEventGeneratedSignal().Connect( mSlotDelegate, &KeyInputFocusManager::OnKeyEvent ); +} + void KeyInputFocusManager::SetFocus( Toolkit::Control control ) { if( !control )