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

Unified Diff: ui/events/platform/x11/x11_event_source.h

Issue 1602173005: Add PlatformWindow/Event related code for Ozone X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix deps problem. 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/events/platform/x11/x11_event_source.h
diff --git a/ui/events/platform/x11/x11_event_source.h b/ui/events/platform/x11/x11_event_source.h
index 26d646016607273684183310df1a393d8e0d1558..292136630c0ed848d38d2fd137f29919caf3f0c0 100644
--- a/ui/events/platform/x11/x11_event_source.h
+++ b/ui/events/platform/x11/x11_event_source.h
@@ -13,8 +13,6 @@
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/x11_types.h"
-typedef struct _GPollFD GPollFD;
-typedef struct _GSource GSource;
typedef union _XEvent XEvent;
typedef unsigned long XID;
@@ -22,8 +20,8 @@ namespace ui {
class X11HotplugEventHandler;
-// A PlatformEventSource implementation for reading events from X11 server and
-// dispatching the events to the appropriate dispatcher.
+// Abstract PlatformEventSource implementation for reading events from X11
+// server.
class EVENTS_EXPORT X11EventSource : public PlatformEventSource {
public:
explicit X11EventSource(XDisplay* display);
@@ -31,7 +29,7 @@ class EVENTS_EXPORT X11EventSource : public PlatformEventSource {
static X11EventSource* GetInstance();
- // Called by the glib source dispatch function. Processes all (if any)
+ // Called when there is a new XEvent available. Processes all (if any)
// available X events.
void DispatchXEvents();
@@ -47,25 +45,27 @@ class EVENTS_EXPORT X11EventSource : public PlatformEventSource {
void BlockUntilWindowMapped(XID window);
protected:
- XDisplay* display() { return display_; }
-
- private:
// Extracts cookie data from |xevent| if it's of GenericType, and dispatches
// the event. This function also frees up the cookie data after dispatch is
// complete.
- uint32_t ExtractCookieDataDispatchEvent(XEvent* xevent);
+ void ExtractCookieDataDispatchEvent(XEvent* xevent);
+
+ // Handles updates after event has been dispatched.
+ void PostDispatchEvent(XEvent* xevent);
// PlatformEventSource:
- uint32_t DispatchEvent(XEvent* xevent) override;
void StopCurrentEventStream() override;
void OnDispatcherListChanged() override;
+ XDisplay* display() { return display_; }
+
+ private:
// The connection to the X11 server used to receive the events.
XDisplay* display_;
// Keeps track of whether this source should continue to dispatch all the
// available events.
- bool continue_stream_;
+ bool continue_stream_ = true;
scoped_ptr<X11HotplugEventHandler> hotplug_event_handler_;

Powered by Google App Engine
This is Rietveld 408576698