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

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

Issue 2398343002: X11: Avoid round-tripping to get the cursor position (Closed)
Patch Set: Add DCHECK Created 4 years, 2 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 | « no previous file | ui/events/platform/x11/x11_event_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cf4051517a0a5cd24c13a4643f1c7724fdf0c11b..927e67d803e6bae145f6150498b8ae9380016f82 100644
--- a/ui/events/platform/x11/x11_event_source.h
+++ b/ui/events/platform/x11/x11_event_source.h
@@ -8,8 +8,10 @@
#include <stdint.h>
#include <memory>
+#include <stack>
#include "base/macros.h"
+#include "base/optional.h"
#include "ui/events/events_export.h"
#include "ui/gfx/x/x11_types.h"
@@ -18,6 +20,10 @@ using XEvent = union _XEvent;
using XID = unsigned long;
using XWindow = unsigned long;
+namespace gfx {
+class Point;
+}
+
namespace ui {
class X11HotplugEventHandler;
@@ -77,6 +83,10 @@ class EVENTS_EXPORT X11EventSource {
// current event does not have a timestamp.
Time GetTimestamp();
+ // Returns the root pointer location only if there is an event being
+ // dispatched that contains that information.
+ base::Optional<gfx::Point> GetRootCursorLocationFromCurrentEvent() const;
+
void StopCurrentEventStream();
void OnDispatcherListChanged();
@@ -105,8 +115,9 @@ class EVENTS_EXPORT X11EventSource {
// The connection to the X11 server used to receive the events.
XDisplay* display_;
- // The timestamp of the event being dispatched.
- Time event_timestamp_;
+ // Events currently being dispatched. The topmost event in this stack
+ // corresponds to the deepest-nested message loop.
+ std::stack<XEvent*> dispatching_events_;
// State necessary for UpdateLastSeenServerTime
bool dummy_initialized_;
« no previous file with comments | « no previous file | ui/events/platform/x11/x11_event_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698