X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ffocus-manager%2Fkeyinput-focus-manager-impl.cpp;h=cb62a9120b6680e9db0a794023115b16b7b09bfb;hb=refs%2Fchanges%2F20%2F238520%2F3;hp=f188281f955e39232271d3390b2d47d1927443f4;hpb=aa906fd49430568986b95c51bd29f3a58c33272f;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..cb62a91 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) 2020 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. @@ -21,12 +21,10 @@ // EXTERNAL INCLUDES #include // for strcmp #include -#include -#include - -// INTERNAL INCLUDES #include #include +#include +#include namespace Dali { @@ -50,13 +48,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 )