Chromium Code Reviews| Index: chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc |
| diff --git a/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc b/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc |
| index e48c18612d105abdcf2023fa1d398a0919b9718c..260b7792b7a75da3d8d2a0557711534959548759 100644 |
| --- a/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc |
| +++ b/chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc |
| @@ -10,6 +10,7 @@ |
| #include <X11/X.h> |
| #include "base/memory/singleton.h" |
| +#include "ui/events/platform/x11/x11_event_source.h" |
| #include "ui/gfx/x/x11_types.h" |
| namespace libgtk2ui { |
| @@ -70,7 +71,12 @@ void Gtk2EventLoop::ProcessGdkEventKey(const GdkEventKey& gdk_event_key) { |
| x_event.xkey.keycode = gdk_event_key.hardware_keycode; |
| x_event.xkey.same_screen = true; |
| - XPutBackEvent(x_event.xkey.display, &x_event); |
| + // We want to process the gtk2 event; mapped to an X11 event immediately |
| + // otherwise if we put it back on the queue we may get items out of order. |
| + if (ui::X11EventSource* x11_source = ui::X11EventSource::GetInstance()) |
| + x11_source->DispatchEventNow(&x_event); |
| + else |
| + XPutBackEvent(x_event.xkey.display, &x_event); |
|
sadrul
2015/09/02 17:18:52
Can we send this key-event directly to the InputMe
|
| } |
| } // namespace libgtk2ui |