Chromium Code Reviews| 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 25 matching lines...) Expand all Loading... | |
| 36 gdk_window_add_filter(NULL, &GdkEventFilter, this); | 36 gdk_window_add_filter(NULL, &GdkEventFilter, this); |
| 37 gdk_event_handler_set(&EventDispatcherX, this, NULL); | 37 gdk_event_handler_set(&EventDispatcherX, this, NULL); |
| 38 | 38 |
| 39 #if defined(HAVE_XINPUT2) | 39 #if defined(HAVE_XINPUT2) |
| 40 InitializeXInput2(); | 40 InitializeXInput2(); |
| 41 #endif | 41 #endif |
| 42 InitializeEventsToCapture(); | 42 InitializeEventsToCapture(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 MessagePumpGlibX::~MessagePumpGlibX() { | 45 MessagePumpGlibX::~MessagePumpGlibX() { |
| 46 // Remove the filter. | |
|
Evan Martin
2011/05/25 18:56:06
I guess this comment isn't very useful, since it's
sadrul
2011/05/25 19:00:05
I agree; it's fairly clear what's happening. Remov
| |
| 47 gdk_window_remove_filter(NULL, &GdkEventFilter, this); | |
| 48 | |
| 49 // It is not necessary to reset the GDK event handler using | |
| 50 // gdk_event_handler_set since it's done in the destructor for | |
| 51 // MessagePumpForUI. | |
| 46 } | 52 } |
| 47 | 53 |
| 48 bool MessagePumpGlibX::ShouldCaptureXEvent(XEvent* xev) { | 54 bool MessagePumpGlibX::ShouldCaptureXEvent(XEvent* xev) { |
| 49 return capture_x_events_[xev->type] | 55 return capture_x_events_[xev->type] |
| 50 #if defined(HAVE_XINPUT2) | 56 #if defined(HAVE_XINPUT2) |
| 51 && (xev->type != GenericEvent || xev->xcookie.extension == xiopcode_) | 57 && (xev->type != GenericEvent || xev->xcookie.extension == xiopcode_) |
| 52 #endif | 58 #endif |
| 53 ; | 59 ; |
| 54 } | 60 } |
| 55 | 61 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 return; | 226 return; |
| 221 } | 227 } |
| 222 } | 228 } |
| 223 #endif // HAVE_XINPUT2 | 229 #endif // HAVE_XINPUT2 |
| 224 | 230 |
| 225 bool MessagePumpXObserver::WillProcessXEvent(XEvent* xev) { | 231 bool MessagePumpXObserver::WillProcessXEvent(XEvent* xev) { |
| 226 return false; | 232 return false; |
| 227 } | 233 } |
| 228 | 234 |
| 229 } // namespace base | 235 } // namespace base |
| OLD | NEW |