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

Side by Side Diff: base/message_pump_glib_x.cc

Issue 7019007: Update the X11 keycodes when keys are remapped. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unify Created 9 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/system_key_event_listener.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 "base/message_pump_glib_x.h" 5 #include "base/message_pump_glib_x.h"
6 6
7 #include <gdk/gdkx.h> 7 #include <gdk/gdkx.h>
8 #if defined(HAVE_XINPUT2) 8 #if defined(HAVE_XINPUT2)
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #else 10 #else
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 if (!WillProcessXEvent(&xev)) { 73 if (!WillProcessXEvent(&xev)) {
74 MessagePumpGlibXDispatcher::DispatchStatus status = 74 MessagePumpGlibXDispatcher::DispatchStatus status =
75 static_cast<MessagePumpGlibXDispatcher*> 75 static_cast<MessagePumpGlibXDispatcher*>
76 (GetDispatcher())->DispatchX(&xev); 76 (GetDispatcher())->DispatchX(&xev);
77 77
78 if (status == MessagePumpGlibXDispatcher::EVENT_QUIT) { 78 if (status == MessagePumpGlibXDispatcher::EVENT_QUIT) {
79 should_quit = true; 79 should_quit = true;
80 Quit(); 80 Quit();
81 } else if (status == MessagePumpGlibXDispatcher::EVENT_IGNORED) { 81 } else if (status == MessagePumpGlibXDispatcher::EVENT_IGNORED) {
82 DLOG(WARNING) << "Event (" << xev.type << ") not handled.";
83 } 82 }
84 } 83 }
85 84
86 #if defined(HAVE_XINPUT2) 85 #if defined(HAVE_XINPUT2)
87 if (have_cookie) { 86 if (have_cookie) {
88 XFreeEventData(xev.xgeneric.display, &xev.xcookie); 87 XFreeEventData(xev.xgeneric.display, &xev.xcookie);
89 } 88 }
90 #endif 89 #endif
91 } else { 90 } else {
92 // TODO(sad): A couple of extra events can still sneak in during this. 91 // TODO(sad): A couple of extra events can still sneak in during this.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 163
165 capture_x_events_[ButtonPress] = true; 164 capture_x_events_[ButtonPress] = true;
166 capture_gdk_events_[GDK_BUTTON_PRESS] = true; 165 capture_gdk_events_[GDK_BUTTON_PRESS] = true;
167 166
168 capture_x_events_[ButtonRelease] = true; 167 capture_x_events_[ButtonRelease] = true;
169 capture_gdk_events_[GDK_BUTTON_RELEASE] = true; 168 capture_gdk_events_[GDK_BUTTON_RELEASE] = true;
170 169
171 capture_x_events_[MotionNotify] = true; 170 capture_x_events_[MotionNotify] = true;
172 capture_gdk_events_[GDK_MOTION_NOTIFY] = true; 171 capture_gdk_events_[GDK_MOTION_NOTIFY] = true;
173 172
173 capture_x_events_[MappingNotify] = true;
174
174 #if defined(HAVE_XINPUT2) 175 #if defined(HAVE_XINPUT2)
175 capture_x_events_[GenericEvent] = true; 176 capture_x_events_[GenericEvent] = true;
176 #endif 177 #endif
177 } 178 }
178 179
179 #if defined(HAVE_XINPUT2) 180 #if defined(HAVE_XINPUT2)
180 void MessagePumpGlibX::InitializeXInput2(void) { 181 void MessagePumpGlibX::InitializeXInput2(void) {
181 GdkDisplay* display = gdk_display_get_default(); 182 GdkDisplay* display = gdk_display_get_default();
182 if (!display) 183 if (!display)
183 return; 184 return;
(...skipping 14 matching lines...) Expand all
198 return; 199 return;
199 } 200 }
200 } 201 }
201 #endif // HAVE_XINPUT2 202 #endif // HAVE_XINPUT2
202 203
203 bool MessagePumpXObserver::WillProcessXEvent(XEvent* xev) { 204 bool MessagePumpXObserver::WillProcessXEvent(XEvent* xev) {
204 return false; 205 return false;
205 } 206 }
206 207
207 } // namespace base 208 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/system_key_event_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698