Index: ui/ozone/platform/wayland/wayland_window.h |
diff --git a/ui/ozone/platform/wayland/wayland_window.h b/ui/ozone/platform/wayland/wayland_window.h |
index 8b8d5a20871dee01f3e7c10340940cec6a8a657f..2721c46ac600f3750d4946e9522c9886bacf9ea7 100644 |
--- a/ui/ozone/platform/wayland/wayland_window.h |
+++ b/ui/ozone/platform/wayland/wayland_window.h |
@@ -5,6 +5,7 @@ |
#ifndef UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_ |
#define UI_OZONE_PLATFORM_WAYLAND_WAYLAND_WINDOW_H_ |
+#include "ui/events/platform/platform_event_dispatcher.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/native_widget_types.h" |
#include "ui/ozone/platform/wayland/wayland_object.h" |
@@ -14,13 +15,15 @@ namespace ui { |
class WaylandDisplay; |
-class WaylandWindow : public PlatformWindow { |
+class WaylandWindow : public PlatformWindow, public PlatformEventDispatcher { |
public: |
WaylandWindow(PlatformWindowDelegate* delegate, |
WaylandDisplay* display, |
const gfx::Rect& bounds); |
~WaylandWindow() override; |
+ static WaylandWindow* FromSurface(wl_surface* surface); |
+ |
bool Initialize(); |
wl_surface* GetSurface(); |
@@ -30,6 +33,9 @@ class WaylandWindow : public PlatformWindow { |
// be called after processing all pending events in the wayland connection. |
void ApplyPendingBounds(); |
+ // Set whether this window has pointer focus and should dispatch mouse events. |
+ void set_pointer_focus(bool focus) { has_pointer_focus_ = focus; } |
+ |
// PlatformWindow |
void Show() override; |
void Hide() override; |
@@ -48,6 +54,10 @@ class WaylandWindow : public PlatformWindow { |
void ConfineCursorToBounds(const gfx::Rect& bounds) override; |
PlatformImeController* GetPlatformImeController() override; |
+ // PlatformEventDispatcher |
+ bool CanDispatchEvent(const PlatformEvent& event) override; |
+ uint32_t DispatchEvent(const PlatformEvent& event) override; |
+ |
// xdg_surface_listener |
static void Configure(void* data, |
xdg_surface* obj, |
@@ -67,6 +77,7 @@ class WaylandWindow : public PlatformWindow { |
gfx::Rect bounds_; |
gfx::Rect pending_bounds_; |
uint32_t pending_configure_serial_; |
+ bool has_pointer_focus_ = false; |
DISALLOW_COPY_AND_ASSIGN(WaylandWindow); |
}; |