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

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

Issue 8597010: Send fake event when event_type is set to exit menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use xdisplay_ Created 9 years, 1 month 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
« no previous file with comments | « ui/base/win/events_win.cc ('k') | views/controls/menu/menu_controller.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "ui/base/events.h"
6 6
7 #include <X11/Xlib.h>
7 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
8 9
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "ui/base/keycodes/keyboard_code_conversion_x.h" 11 #include "ui/base/keycodes/keyboard_code_conversion_x.h"
11 #include "ui/base/touch/touch_factory.h" 12 #include "ui/base/touch/touch_factory.h"
12 #include "ui/gfx/point.h" 13 #include "ui/gfx/point.h"
13 14
14 namespace { 15 namespace {
15 16
16 // Scroll amount for each wheelscroll event. 53 is also the value used for GTK+. 17 // Scroll amount for each wheelscroll event. 53 is also the value used for GTK+.
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 0.0); 348 0.0);
348 unsigned int deviceid = 349 unsigned int deviceid =
349 static_cast<XIDeviceEvent*>(native_event->xcookie.data)->sourceid; 350 static_cast<XIDeviceEvent*>(native_event->xcookie.data)->sourceid;
350 // Force is normalized to fall into [0, 1] 351 // Force is normalized to fall into [0, 1]
351 if (!ui::TouchFactory::GetInstance()->NormalizeTouchParam( 352 if (!ui::TouchFactory::GetInstance()->NormalizeTouchParam(
352 deviceid, ui::TouchFactory::TP_PRESSURE, &force)) 353 deviceid, ui::TouchFactory::TP_PRESSURE, &force))
353 force = 0.0; 354 force = 0.0;
354 return force; 355 return force;
355 } 356 }
356 357
358 base::NativeEvent CreateNoopEvent() {
359 static XEvent* noop = new XEvent();
360 noop->xclient.type = ClientMessage;
361 noop->xclient.display = NULL;
362 noop->xclient.window = None;
363 noop->xclient.message_type = 0;
364 noop->xclient.format = 0;
365 return noop;
366 }
367
357 } // namespace ui 368 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/win/events_win.cc ('k') | views/controls/menu/menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698