OLD | NEW |
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 #include "ui/events/platform/x11/x11_event_source.h" | 5 #include "ui/events/platform/x11/x11_event_source.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/XKBlib.h> | 8 #include <X11/XKBlib.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 void X11EventSource::DispatchXEventNow(XEvent* event) { | 143 void X11EventSource::DispatchXEventNow(XEvent* event) { |
144 ExtractCookieDataDispatchEvent(event); | 144 ExtractCookieDataDispatchEvent(event); |
145 } | 145 } |
146 | 146 |
147 void X11EventSource::BlockUntilWindowMapped(XID window) { | 147 void X11EventSource::BlockUntilWindowMapped(XID window) { |
148 BlockOnWindowStructureEvent(window, MapNotify); | 148 BlockOnWindowStructureEvent(window, MapNotify); |
149 } | 149 } |
150 | 150 |
151 void X11EventSource::BlockUntilWindowUnmapped(XID window) { | |
152 BlockOnWindowStructureEvent(window, UnmapNotify); | |
153 } | |
154 | |
155 Time X11EventSource::GetCurrentServerTime() { | 151 Time X11EventSource::GetCurrentServerTime() { |
156 DCHECK(display_); | 152 DCHECK(display_); |
157 | 153 |
158 if (!dummy_initialized_) { | 154 if (!dummy_initialized_) { |
159 // Create a new Window and Atom that will be used for the property change. | 155 // Create a new Window and Atom that will be used for the property change. |
160 dummy_window_ = XCreateSimpleWindow(display_, DefaultRootWindow(display_), | 156 dummy_window_ = XCreateSimpleWindow(display_, DefaultRootWindow(display_), |
161 0, 0, 1, 1, 0, 0, 0); | 157 0, 0, 1, 1, 0, 0, 0); |
162 dummy_atom_ = XInternAtom(display_, "CHROMIUM_TIMESTAMP", False); | 158 dummy_atom_ = XInternAtom(display_, "CHROMIUM_TIMESTAMP", False); |
163 XSelectInput(display_, dummy_window_, PropertyChangeMask); | 159 XSelectInput(display_, dummy_window_, PropertyChangeMask); |
164 dummy_initialized_ = true; | 160 dummy_initialized_ = true; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 254 |
259 void X11EventSource::OnDispatcherListChanged() { | 255 void X11EventSource::OnDispatcherListChanged() { |
260 if (!hotplug_event_handler_) { | 256 if (!hotplug_event_handler_) { |
261 hotplug_event_handler_.reset(new X11HotplugEventHandler()); | 257 hotplug_event_handler_.reset(new X11HotplugEventHandler()); |
262 // Force the initial device query to have an update list of active devices. | 258 // Force the initial device query to have an update list of active devices. |
263 hotplug_event_handler_->OnHotplugEvent(); | 259 hotplug_event_handler_->OnHotplugEvent(); |
264 } | 260 } |
265 } | 261 } |
266 | 262 |
267 } // namespace ui | 263 } // namespace ui |
OLD | NEW |