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_x.h" | 5 #include "base/message_pump_x.h" |
6 | 6 |
7 #include <gdk/gdkx.h> | 7 #include <gdk/gdkx.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 MessagePumpX* pump_x = reinterpret_cast<MessagePumpX*>(data); | 244 MessagePumpX* pump_x = reinterpret_cast<MessagePumpX*>(data); |
245 CHECK(use_gtk_message_pump) << "GdkEvent:" << event->type; | 245 CHECK(use_gtk_message_pump) << "GdkEvent:" << event->type; |
246 | 246 |
247 if (!pump_x->gdksource_) { | 247 if (!pump_x->gdksource_) { |
248 pump_x->gdksource_ = g_main_current_source(); | 248 pump_x->gdksource_ = g_main_current_source(); |
249 if (pump_x->gdksource_) | 249 if (pump_x->gdksource_) |
250 pump_x->gdkdispatcher_ = pump_x->gdksource_->source_funcs->dispatch; | 250 pump_x->gdkdispatcher_ = pump_x->gdksource_->source_funcs->dispatch; |
251 } else if (!pump_x->IsDispatchingEvent()) { | 251 } else if (!pump_x->IsDispatchingEvent()) { |
252 if (event->type != GDK_NOTHING && | 252 if (event->type != GDK_NOTHING && |
253 pump_x->capture_gdk_events_[event->type]) { | 253 pump_x->capture_gdk_events_[event->type]) { |
254 NOTREACHED() << "GDK received an event it shouldn't have"; | 254 NOTREACHED() << "GDK received an event it shouldn't have:" << event->type; |
255 } | 255 } |
256 } | 256 } |
257 | 257 |
258 gtk_main_do_event(event); | 258 gtk_main_do_event(event); |
259 } | 259 } |
260 | 260 |
261 void MessagePumpX::InitializeEventsToCapture(void) { | 261 void MessagePumpX::InitializeEventsToCapture(void) { |
262 // TODO(sad): Decide which events we want to capture and update the tables | 262 // TODO(sad): Decide which events we want to capture and update the tables |
263 // accordingly. | 263 // accordingly. |
264 capture_x_events_[KeyPress] = true; | 264 capture_x_events_[KeyPress] = true; |
(...skipping 15 matching lines...) Expand all Loading... |
280 } | 280 } |
281 | 281 |
282 MessagePumpObserver::EventStatus | 282 MessagePumpObserver::EventStatus |
283 MessagePumpObserver::WillProcessXEvent(XEvent* xev) { | 283 MessagePumpObserver::WillProcessXEvent(XEvent* xev) { |
284 return EVENT_CONTINUE; | 284 return EVENT_CONTINUE; |
285 } | 285 } |
286 | 286 |
287 COMPILE_ASSERT(XLASTEvent >= LASTEvent, XLASTEvent_too_small); | 287 COMPILE_ASSERT(XLASTEvent >= LASTEvent, XLASTEvent_too_small); |
288 | 288 |
289 } // namespace base | 289 } // namespace base |
OLD | NEW |