OLD | NEW |
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 Loading... |
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."; | 82 VLOG(1) << "Event (" << xev->type << ") not handled."; |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 #if defined(HAVE_XINPUT2) | 86 #if defined(HAVE_XINPUT2) |
87 if (have_cookie) { | 87 if (have_cookie) { |
88 XFreeEventData(xev->xgeneric.display, &xev->xcookie); | 88 XFreeEventData(xev->xgeneric.display, &xev->xcookie); |
89 } | 89 } |
90 #endif | 90 #endif |
91 | 91 |
92 return should_quit; | 92 return should_quit; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 #if defined(HAVE_XINPUT2) | 206 #if defined(HAVE_XINPUT2) |
207 void MessagePumpGlibX::InitializeXInput2(void) { | 207 void MessagePumpGlibX::InitializeXInput2(void) { |
208 GdkDisplay* display = gdk_display_get_default(); | 208 GdkDisplay* display = gdk_display_get_default(); |
209 if (!display) | 209 if (!display) |
210 return; | 210 return; |
211 | 211 |
212 Display* xdisplay = GDK_DISPLAY_XDISPLAY(display); | 212 Display* xdisplay = GDK_DISPLAY_XDISPLAY(display); |
213 int event, err; | 213 int event, err; |
214 | 214 |
215 if (!XQueryExtension(xdisplay, "XInputExtension", &xiopcode_, &event, &err)) { | 215 if (!XQueryExtension(xdisplay, "XInputExtension", &xiopcode_, &event, &err)) { |
216 DLOG(WARNING) << "X Input extension not available."; | 216 VLOG(1) << "X Input extension not available."; |
217 xiopcode_ = -1; | 217 xiopcode_ = -1; |
218 return; | 218 return; |
219 } | 219 } |
220 | 220 |
221 int major = 2, minor = 0; | 221 int major = 2, minor = 0; |
222 if (XIQueryVersion(xdisplay, &major, &minor) == BadRequest) { | 222 if (XIQueryVersion(xdisplay, &major, &minor) == BadRequest) { |
223 DLOG(WARNING) << "XInput2 not supported in the server."; | 223 VLOG(1) << "XInput2 not supported in the server."; |
224 xiopcode_ = -1; | 224 xiopcode_ = -1; |
225 return; | 225 return; |
226 } | 226 } |
227 } | 227 } |
228 #endif // HAVE_XINPUT2 | 228 #endif // HAVE_XINPUT2 |
229 | 229 |
230 bool MessagePumpXObserver::WillProcessXEvent(XEvent* xev) { | 230 bool MessagePumpXObserver::WillProcessXEvent(XEvent* xev) { |
231 return false; | 231 return false; |
232 } | 232 } |
233 | 233 |
234 } // namespace base | 234 } // namespace base |
OLD | NEW |