Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ui / views / widget / desktop_aura / x11_window_event_filter.h
index 41f2454..5c7e722 100644 (file)
@@ -6,8 +6,6 @@
 #define UI_VIEWS_WIDGET_DESKTOP_AURA_X11_WINDOW_EVENT_FILTER_H_
 
 #include <X11/Xlib.h>
-// Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class.
-#undef RootWindow
 
 #include "base/compiler_specific.h"
 #include "base/message_loop/message_loop.h"
@@ -17,7 +15,6 @@
 #include "ui/views/views_export.h"
 
 namespace aura {
-class RootWindow;
 class Window;
 }
 
@@ -32,8 +29,7 @@ class NativeWidgetAura;
 // An EventFilter that sets properties on X11 windows.
 class VIEWS_EXPORT X11WindowEventFilter : public ui::EventHandler {
  public:
-  X11WindowEventFilter(aura::RootWindow* root_window,
-                       DesktopWindowTreeHost* window_tree_host);
+  explicit X11WindowEventFilter(DesktopWindowTreeHost* window_tree_host);
   virtual ~X11WindowEventFilter();
 
   // Changes whether borders are shown on this |root_window|.
@@ -43,6 +39,8 @@ class VIEWS_EXPORT X11WindowEventFilter : public ui::EventHandler {
   virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE;
 
  private:
+  void ToggleMaximizedState();
+
   // Dispatches a _NET_WM_MOVERESIZE message to the window manager to tell it
   // to act as if a border or titlebar drag occurred.
   bool DispatchHostWindowDragMovement(int hittest,
@@ -62,6 +60,13 @@ class VIEWS_EXPORT X11WindowEventFilter : public ui::EventHandler {
   // True if |xwindow_| is the current _NET_ACTIVE_WINDOW.
   bool is_active_;
 
+  // The non-client component for the target of a MouseEvent. Mouse events can
+  // be destructive to the window tree, which can cause the component of a
+  // ui::EF_IS_DOUBLE_CLICK event to no longer be the same as that of the
+  // initial click. Acting on a double click should only occur for matching
+  // components.
+  int click_component_;
+
   DISALLOW_COPY_AND_ASSIGN(X11WindowEventFilter);
 };