Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ui / views / widget / desktop_aura / x11_desktop_handler.cc
index e5dd2c1..198b9c6 100644 (file)
@@ -14,7 +14,7 @@
 
 #if !defined(OS_CHROMEOS)
 #include "ui/views/ime/input_method.h"
-#include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h"
+#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
 #endif
 
 namespace {
@@ -139,12 +139,17 @@ void X11DesktopHandler::ProcessXEvent(const base::NativeEvent& event) {
           current_window_ == event->xcrossing.window)
         OnActiveWindowChanged(None);
       break;
+    case FocusIn:
+      if (event->xfocus.mode == NotifyNormal &&
+          current_window_ != event->xfocus.window)
+        OnActiveWindowChanged(event->xfocus.window);
+      break;
     default:
       NOTREACHED();
   }
 }
 
-bool X11DesktopHandler::Dispatch(const base::NativeEvent& event) {
+uint32_t X11DesktopHandler::Dispatch(const base::NativeEvent& event) {
   // Check for a change to the active window.
   switch (event->type) {
     case PropertyNotify: {
@@ -162,7 +167,7 @@ bool X11DesktopHandler::Dispatch(const base::NativeEvent& event) {
     }
   }
 
-  return true;
+  return POST_DISPATCH_NONE;
 }
 
 void X11DesktopHandler::OnWindowInitialized(aura::Window* window) {