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

Side by Side Diff: ui/events/platform/x11/x11_event_source.h

Issue 2568233003: X11: Reset dispatching event when nested message loop ends (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/platform/x11/x11_event_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ 5 #ifndef UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_
6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ 6 #define UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <stack>
12 11
13 #include "base/macros.h" 12 #include "base/macros.h"
14 #include "base/optional.h" 13 #include "base/optional.h"
15 #include "ui/events/events_export.h" 14 #include "ui/events/events_export.h"
16 #include "ui/gfx/x/x11_types.h" 15 #include "ui/gfx/x/x11_types.h"
17 16
18 using Time = unsigned long; 17 using Time = unsigned long;
19 using XEvent = union _XEvent; 18 using XEvent = union _XEvent;
20 using XID = unsigned long; 19 using XID = unsigned long;
21 using XWindow = unsigned long; 20 using XWindow = unsigned long;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 Time GetCurrentServerTime(); 107 Time GetCurrentServerTime();
109 108
110 private: 109 private:
111 static X11EventSource* instance_; 110 static X11EventSource* instance_;
112 111
113 X11EventSourceDelegate* delegate_; 112 X11EventSourceDelegate* delegate_;
114 113
115 // The connection to the X11 server used to receive the events. 114 // The connection to the X11 server used to receive the events.
116 XDisplay* display_; 115 XDisplay* display_;
117 116
118 // Events currently being dispatched. The topmost event in this stack 117 // Event currently being dispatched.
119 // corresponds to the deepest-nested message loop. 118 XEvent* dispatching_event_;
120 std::stack<XEvent*> dispatching_events_;
121 119
122 // State necessary for UpdateLastSeenServerTime 120 // State necessary for UpdateLastSeenServerTime
123 bool dummy_initialized_; 121 bool dummy_initialized_;
124 XWindow dummy_window_; 122 XWindow dummy_window_;
125 XAtom dummy_atom_; 123 XAtom dummy_atom_;
126 std::unique_ptr<XScopedEventSelector> dummy_window_events_; 124 std::unique_ptr<XScopedEventSelector> dummy_window_events_;
127 125
128 // Keeps track of whether this source should continue to dispatch all the 126 // Keeps track of whether this source should continue to dispatch all the
129 // available events. 127 // available events.
130 bool continue_stream_ = true; 128 bool continue_stream_ = true;
131 129
132 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_; 130 std::unique_ptr<X11HotplugEventHandler> hotplug_event_handler_;
133 131
134 DISALLOW_COPY_AND_ASSIGN(X11EventSource); 132 DISALLOW_COPY_AND_ASSIGN(X11EventSource);
135 }; 133 };
136 134
137 } // namespace ui 135 } // namespace ui
138 136
139 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_ 137 #endif // UI_EVENTS_PLATFORM_X11_X11_EVENT_SOURCE_H_
OLDNEW
« 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