diff options
Diffstat (limited to 'win8/metro_driver')
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.cc | 29 | ||||
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.h | 4 |
2 files changed, 8 insertions, 25 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index cffb043..b795b92 100644 --- a/win8/metro_driver/chrome_app_view_ash.cc +++ b/win8/metro_driver/chrome_app_view_ash.cc @@ -50,10 +50,6 @@ typedef winfoundtn::ITypedEventHandler< typedef winfoundtn::ITypedEventHandler< winui::Core::CoreWindow*, - winui::Core::VisibilityChangedEventArgs*> VisibilityChangedHandler; - -typedef winfoundtn::ITypedEventHandler< - winui::Core::CoreWindow*, winui::Core::WindowActivatedEventArgs*> WindowActivatedHandler; typedef winfoundtn::ITypedEventHandler< @@ -422,11 +418,6 @@ ChromeAppViewAsh::SetWindow(winui::Core::ICoreWindow* window) { &character_received_token_); CheckHR(hr); - hr = window_->add_VisibilityChanged(mswr::Callback<VisibilityChangedHandler>( - this, &ChromeAppViewAsh::OnVisibilityChanged).Get(), - &visibility_changed_token_); - CheckHR(hr); - hr = window_->add_Activated(mswr::Callback<WindowActivatedHandler>( this, &ChromeAppViewAsh::OnWindowActivated).Get(), &window_activated_token_); @@ -880,18 +871,6 @@ HRESULT ChromeAppViewAsh::OnCharacterReceived( return S_OK; } -HRESULT ChromeAppViewAsh::OnVisibilityChanged( - winui::Core::ICoreWindow* sender, - winui::Core::IVisibilityChangedEventArgs* args) { - boolean visible = false; - HRESULT hr = args->get_Visible(&visible); - if (FAILED(hr)) - return hr; - - ui_channel_->Send(new MetroViewerHostMsg_VisibilityChanged(!!visible)); - return S_OK; -} - HRESULT ChromeAppViewAsh::OnWindowActivated( winui::Core::ICoreWindow* sender, winui::Core::IWindowActivatedEventArgs* args) { @@ -899,6 +878,14 @@ HRESULT ChromeAppViewAsh::OnWindowActivated( HRESULT hr = args->get_WindowActivationState(&state); if (FAILED(hr)) return hr; + + // Treat both full activation (Ash was reopened from the Start Screen or from + // any other Metro entry point in Windows) and pointer activation (user + // clicked back in Ash after using another app on another monitor) the same. + if (state == winui::Core::CoreWindowActivationState_CodeActivated || + state == winui::Core::CoreWindowActivationState_PointerActivated) { + ui_channel_->Send(new MetroViewerHostMsg_WindowActivated()); + } return S_OK; } diff --git a/win8/metro_driver/chrome_app_view_ash.h b/win8/metro_driver/chrome_app_view_ash.h index c1b9533..0f9a14a 100644 --- a/win8/metro_driver/chrome_app_view_ash.h +++ b/win8/metro_driver/chrome_app_view_ash.h @@ -110,9 +110,6 @@ class ChromeAppViewAsh HRESULT OnCharacterReceived(winui::Core::ICoreWindow* sender, winui::Core::ICharacterReceivedEventArgs* args); - HRESULT OnVisibilityChanged(winui::Core::ICoreWindow* sender, - winui::Core::IVisibilityChangedEventArgs* args); - HRESULT OnWindowActivated(winui::Core::ICoreWindow* sender, winui::Core::IWindowActivatedEventArgs* args); @@ -139,7 +136,6 @@ class ChromeAppViewAsh EventRegistrationToken keydown_token_; EventRegistrationToken keyup_token_; EventRegistrationToken character_received_token_; - EventRegistrationToken visibility_changed_token_; EventRegistrationToken accel_keydown_token_; EventRegistrationToken accel_keyup_token_; EventRegistrationToken window_activated_token_; |