Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: ui/ozone/platform/wayland/wayland_window.h

Issue 1712103002: ozone/platform/wayland: Implement pointer handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/wayland/wayland_test.cc ('k') | ui/ozone/platform/wayland/wayland_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 05dba7966c649c088d37926360836fbaf6ca43f6..450df55d05a2d4f4a0a50e895c0597424d0caebe 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* surface() { return surface_.get(); }
@@ -29,6 +32,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;
@@ -47,6 +53,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,
@@ -66,6 +76,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);
};
« no previous file with comments | « ui/ozone/platform/wayland/wayland_test.cc ('k') | ui/ozone/platform/wayland/wayland_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698