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

Unified Diff: ui/platform_window/x11/x11_window.h

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: XEventDispatcher added. Created 4 years, 11 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
Index: ui/platform_window/x11/x11_window.h
diff --git a/ui/platform_window/x11/x11_window.h b/ui/platform_window/x11/x11_window.h
index 54bbed860829f9cb759bd6f66e3e3147d03a5c9b..54808714350712ed79e705a23920c900c78e027f 100644
--- a/ui/platform_window/x11/x11_window.h
+++ b/ui/platform_window/x11/x11_window.h
@@ -7,8 +7,10 @@
#include <stdint.h>
+#include "base/callback.h"
#include "base/macros.h"
#include "ui/events/platform/platform_event_dispatcher.h"
+#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/x/x11_atom_cache.h"
#include "ui/platform_window/platform_window.h"
@@ -17,19 +19,19 @@
typedef struct _XDisplay XDisplay;
typedef unsigned long XID;
+typedef union _XEvent XEvent;
namespace ui {
class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
- public PlatformEventDispatcher {
+ public PlatformEventDispatcher,
+ public XEventDispatcher {
public:
explicit X11Window(PlatformWindowDelegate* delegate);
~X11Window() override;
- private:
- void Destroy();
-
- void ProcessXInput2Event(XEvent* xevent);
+ // Creates new underlying XWindow. Does not map XWindow.
+ void Create();
// PlatformWindow:
void Show() override;
@@ -49,10 +51,19 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
void ConfineCursorToBounds(const gfx::Rect& bounds) override;
PlatformImeController* GetPlatformImeController() override;
+ private:
+ void Destroy();
+
+ void ProcessXInput2Event(XEvent* xev);
+ void ProcessXWindowEvent(const XEvent& xev);
+
// PlatformEventDispatcher:
bool CanDispatchEvent(const PlatformEvent& event) override;
uint32_t DispatchEvent(const PlatformEvent& event) override;
+ // XEventDispatcher:
+ bool DispatchXEvent(const XEvent& xev) override;
+
PlatformWindowDelegate* delegate_;
XDisplay* xdisplay_;
@@ -68,7 +79,7 @@ class X11_WINDOW_EXPORT X11Window : public PlatformWindow,
gfx::Rect requested_bounds_;
gfx::Rect confirmed_bounds_;
- bool window_mapped_;
+ bool window_mapped_ = false;
DISALLOW_COPY_AND_ASSIGN(X11Window);
};

Powered by Google App Engine
This is Rietveld 408576698