Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / win8 / metro_driver / chrome_app_view_ash.cc
index b8f2241..af63093 100644 (file)
@@ -1178,6 +1178,13 @@ HRESULT ChromeAppViewAsh::OnAcceleratorKeyDown(
       break;
 
     case winui::Core::CoreAcceleratorKeyEventType_SystemKeyDown:
+      // Don't send the Alt + F4 combination to Chrome as this is intended to
+      // shut the metro environment down. Reason we check for Control here is
+      // Windows does not shutdown metro if Ctrl is pressed along with Alt F4.
+      // Other key combinations with Alt F4 shutdown metro.
+      if ((virtual_key == VK_F4) && ((keyboard_flags & ui::EF_ALT_DOWN) &&
+          !(keyboard_flags & ui::EF_CONTROL_DOWN)))
+        return S_OK;
       ui_channel_->Send(new MetroViewerHostMsg_KeyDown(virtual_key,
                                                        status.RepeatCount,
                                                        status.ScanCode,
@@ -1288,11 +1295,7 @@ HRESULT ChromeAppViewAsh::HandleProtocolRequest(
 HRESULT ChromeAppViewAsh::OnEdgeGestureCompleted(
     winui::Input::IEdgeGesture* gesture,
     winui::Input::IEdgeGestureEventArgs* args) {
-  // Swipe from edge gesture (and win+z) is equivalent to pressing F11.
-  // TODO(cpu): Make this cleaner for m33.
-  ui_channel_->Send(new MetroViewerHostMsg_KeyDown(VK_F11, 1, 0, 0));
-  ::Sleep(15);
-  ui_channel_->Send(new MetroViewerHostMsg_KeyUp(VK_F11, 1, 0, 0));
+  ui_channel_->Send(new MetroViewerHostMsg_EdgeGesture());
   return S_OK;
 }