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

Unified Diff: ui/aura/root_window_host_x11.cc

Issue 18043004: Set CrOS touchpad Tap Paused property to false during initialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src@git-svn
Patch Set: Address mazda@'s comments Created 7 years, 6 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 | « ui/aura/root_window_host_x11.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window_host_x11.cc
diff --git a/ui/aura/root_window_host_x11.cc b/ui/aura/root_window_host_x11.cc
index 49b6d62ade70f5a3ca4e95ac317568f67ee78040..b8b174f90fbd01f51725bde7cf503af58252aa9c 100644
--- a/ui/aura/root_window_host_x11.cc
+++ b/ui/aura/root_window_host_x11.cc
@@ -771,29 +771,7 @@ void RootWindowHostX11::UnConfineCursor() {
void RootWindowHostX11::OnCursorVisibilityChanged(bool show) {
#if defined(OS_CHROMEOS)
- // Temporarily pause tap-to-click when the cursor is hidden.
- Atom prop = atom_cache_.GetAtom("Tap Paused");
- unsigned char value = !show;
- XIDeviceList dev_list =
- ui::DeviceListCacheX::GetInstance()->GetXI2DeviceList(xdisplay_);
-
- // Only slave pointer devices could possibly have tap-paused property.
- for (int i = 0; i < dev_list.count; i++) {
- if (dev_list[i].use == XISlavePointer) {
- Atom old_type;
- int old_format;
- unsigned long old_nvalues, bytes;
- unsigned char* data;
- int result = XIGetProperty(xdisplay_, dev_list[i].deviceid, prop, 0, 0,
- False, AnyPropertyType, &old_type, &old_format,
- &old_nvalues, &bytes, &data);
- if (result != Success)
- continue;
- XFree(data);
- XIChangeProperty(xdisplay_, dev_list[i].deviceid, prop, XA_INTEGER, 8,
- PropModeReplace, &value, 1);
- }
- }
+ SetCrOSTapPaused(!show);
#endif
}
@@ -909,6 +887,12 @@ void RootWindowHostX11::OnRootWindowInitialized(RootWindow* root_window) {
if (!delegate_ || root_window != GetRootWindow())
return;
UpdateIsInternalDisplay();
+
+#if defined(OS_CHROMEOS)
+ // We have to enable Tap-to-click by default because the cursor is set to
+ // visible in Shell::InitRootWindowController.
+ SetCrOSTapPaused(false);
+#endif
}
bool RootWindowHostX11::DispatchEventForRootWindow(
@@ -1089,6 +1073,32 @@ void RootWindowHostX11::UpdateIsInternalDisplay() {
is_internal_display_ = display.IsInternal();
}
+void RootWindowHostX11::SetCrOSTapPaused(bool state) {
sky 2013/07/01 14:04:26 Can you put the ifdef in this method (similar to O
Shecky Lin 2013/07/02 03:50:30 Done.
+ // Temporarily pause tap-to-click when the cursor is hidden.
+ Atom prop = atom_cache_.GetAtom("Tap Paused");
+ unsigned char value = state;
+ XIDeviceList dev_list =
+ ui::DeviceListCacheX::GetInstance()->GetXI2DeviceList(xdisplay_);
+
+ // Only slave pointer devices could possibly have tap-paused property.
+ for (int i = 0; i < dev_list.count; i++) {
+ if (dev_list[i].use == XISlavePointer) {
+ Atom old_type;
+ int old_format;
+ unsigned long old_nvalues, bytes;
+ unsigned char* data;
+ int result = XIGetProperty(xdisplay_, dev_list[i].deviceid, prop, 0, 0,
+ False, AnyPropertyType, &old_type, &old_format,
+ &old_nvalues, &bytes, &data);
+ if (result != Success)
+ continue;
+ XFree(data);
+ XIChangeProperty(xdisplay_, dev_list[i].deviceid, prop, XA_INTEGER, 8,
+ PropModeReplace, &value, 1);
+ }
+ }
+}
+
// static
RootWindowHost* RootWindowHost::Create(const gfx::Rect& bounds) {
return new RootWindowHostX11(bounds);
« no previous file with comments | « ui/aura/root_window_host_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698