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

Side by Side Diff: ui/base/x/events_x.cc

Issue 23622035: x11: Prefer using ui::GetXDisplay() over getting the Display from the X11 message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/events/event_constants.h" 5 #include "ui/base/events/event_constants.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <X11/extensions/XInput.h> 8 #include <X11/extensions/XInput.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 253
254 double GetTouchParamFromXEvent(XEvent* xev, 254 double GetTouchParamFromXEvent(XEvent* xev,
255 ui::DeviceDataManager::DataType val, 255 ui::DeviceDataManager::DataType val,
256 double default_value) { 256 double default_value) {
257 ui::DeviceDataManager::GetInstance()->GetEventData( 257 ui::DeviceDataManager::GetInstance()->GetEventData(
258 *xev, val, &default_value); 258 *xev, val, &default_value);
259 return default_value; 259 return default_value;
260 } 260 }
261 261
262 Atom GetNoopEventAtom() { 262 Atom GetNoopEventAtom() {
263 return XInternAtom( 263 return XInternAtom(ui::GetXDisplay(), "noop", False);
264 base::MessagePumpX11::GetDefaultXDisplay(),
265 "noop", False);
266 } 264 }
267 265
268 } // namespace 266 } // namespace
269 267
270 namespace ui { 268 namespace ui {
271 269
272 void UpdateDeviceList() { 270 void UpdateDeviceList() {
273 Display* display = GetXDisplay(); 271 Display* display = GetXDisplay();
274 DeviceListCacheX::GetInstance()->UpdateDeviceList(display); 272 DeviceListCacheX::GetInstance()->UpdateDeviceList(display);
275 TouchFactory::GetInstance()->UpdateDeviceList(display); 273 TouchFactory::GetInstance()->UpdateDeviceList(display);
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 noop->xclient.format = 8; 746 noop->xclient.format = 8;
749 DCHECK(!noop->xclient.display); 747 DCHECK(!noop->xclient.display);
750 } 748 }
751 // Make sure we use atom from current xdisplay, which may 749 // Make sure we use atom from current xdisplay, which may
752 // change during the test. 750 // change during the test.
753 noop->xclient.message_type = GetNoopEventAtom(); 751 noop->xclient.message_type = GetNoopEventAtom();
754 return noop; 752 return noop;
755 } 753 }
756 754
757 } // namespace ui 755 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/test/ui_controls_factory_aurax11.cc ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698