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

Unified Diff: base/message_pump_aurax11.cc

Issue 10800050: Call XkbSetDetectableAutoRepeat() on Chrome start-up (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_aurax11.cc
diff --git a/base/message_pump_aurax11.cc b/base/message_pump_aurax11.cc
index 3e21903740cd2fbb3d59a64f18313f169c6234b9..10f95cb3767d9251659438c177257c0b429966c7 100644
--- a/base/message_pump_aurax11.cc
+++ b/base/message_pump_aurax11.cc
@@ -6,6 +6,7 @@
#include <glib.h>
#include <X11/extensions/XInput2.h>
+#include <X11/XKBlib.h>
#include "base/basictypes.h"
#include "base/message_loop.h"
@@ -84,6 +85,30 @@ bool InitializeXInput2() {
return xinput2_supported;
}
+bool InitializeXkb() {
+ Display* display = base::MessagePumpAuraX11::GetDefaultXDisplay();
+ if (!display)
+ return false;
+
+ int opcode, event, error;
+ int major = XkbMajorVersion;
+ int minor = XkbMinorVersion;
+ if (!XkbQueryExtension(display, &opcode, &event, &error, &major, &minor)) {
+ DVLOG(1) << "Xkb extension not available.";
+ return false;
+ }
+
+ // Ask the server not to send KeyRelease event when the user holds down a key.
+ // crbug.com/138092
+ Bool supported_return;
+ if (!XkbSetDetectableAutoRepeat(display, True, &supported_return)) {
+ DVLOG(1) << "XKB not supported in the server.";
+ return false;
+ }
+
+ return true;
+}
+
} // namespace
namespace base {
@@ -91,6 +116,7 @@ namespace base {
MessagePumpAuraX11::MessagePumpAuraX11() : MessagePumpGlib(),
x_source_(NULL) {
InitializeXInput2();
+ InitializeXkb();
InitXSource();
}
« 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