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

Side by Side Diff: base/message_pump_glib_x.cc

Issue 7031057: X message pump: Remove the GDK window event filter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | no next file » | 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 25 matching lines...) Expand all
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698