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

Unified Diff: chrome/browser/ui/libgtk2ui/gtk2_event_loop.cc

Issue 1324913002: Fix out of order key events in Chrome on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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 b77de95991c4d48bdf27f64fbe33aa7d39ecfe16..0b78d76844c5643076cb8763150fd5dda24aec0e 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);
}
} // namespace libgtk2ui

Powered by Google App Engine
This is Rietveld 408576698