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

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

Issue 2630773002: Avoid blocking while mapping an X11 window (Closed)
Patch Set: Address feedback Created 3 years, 9 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 unified diff | Download patch
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 #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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 void X11EventSource::DispatchXEventNow(XEvent* event) { 144 void X11EventSource::DispatchXEventNow(XEvent* event) {
145 ExtractCookieDataDispatchEvent(event); 145 ExtractCookieDataDispatchEvent(event);
146 } 146 }
147 147
148 void X11EventSource::BlockUntilWindowMapped(XID window) { 148 void X11EventSource::BlockUntilWindowMapped(XID window) {
149 BlockOnWindowStructureEvent(window, MapNotify); 149 BlockOnWindowStructureEvent(window, MapNotify);
150 } 150 }
151 151
152 void X11EventSource::BlockUntilWindowUnmapped(XID window) {
153 BlockOnWindowStructureEvent(window, UnmapNotify);
154 }
155
156 Time X11EventSource::GetCurrentServerTime() { 152 Time X11EventSource::GetCurrentServerTime() {
157 DCHECK(display_); 153 DCHECK(display_);
158 154
159 if (!dummy_initialized_) { 155 if (!dummy_initialized_) {
160 // Create a new Window and Atom that will be used for the property change. 156 // Create a new Window and Atom that will be used for the property change.
161 dummy_window_ = XCreateSimpleWindow(display_, DefaultRootWindow(display_), 157 dummy_window_ = XCreateSimpleWindow(display_, DefaultRootWindow(display_),
162 0, 0, 1, 1, 0, 0, 0); 158 0, 0, 1, 1, 0, 0, 0);
163 dummy_atom_ = XInternAtom(display_, "CHROMIUM_TIMESTAMP", False); 159 dummy_atom_ = XInternAtom(display_, "CHROMIUM_TIMESTAMP", False);
164 dummy_window_events_.reset( 160 dummy_window_events_.reset(
165 new XScopedEventSelector(dummy_window_, PropertyChangeMask)); 161 new XScopedEventSelector(dummy_window_, PropertyChangeMask));
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 294
299 void X11EventSource::OnDispatcherListChanged() { 295 void X11EventSource::OnDispatcherListChanged() {
300 if (!hotplug_event_handler_) { 296 if (!hotplug_event_handler_) {
301 hotplug_event_handler_.reset(new X11HotplugEventHandler()); 297 hotplug_event_handler_.reset(new X11HotplugEventHandler());
302 // Force the initial device query to have an update list of active devices. 298 // Force the initial device query to have an update list of active devices.
303 hotplug_event_handler_->OnHotplugEvent(); 299 hotplug_event_handler_->OnHotplugEvent();
304 } 300 }
305 } 301 }
306 302
307 } // namespace ui 303 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/platform/x11/x11_event_source.h ('k') | ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698