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

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: Handle the problem in RootWindowHostX11 instead 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 d0709cc0530b0deaf5c525e6a9283f49e4ee1d0a..f769fa47232e62b075dd18bdb564bbcbc16dc977 100644
--- a/ui/aura/root_window_host_x11.cc
+++ b/ui/aura/root_window_host_x11.cc
@@ -770,29 +770,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
}
@@ -908,6 +886,10 @@ void RootWindowHostX11::OnRootWindowInitialized(RootWindow* root_window) {
if (!delegate_ || root_window != GetRootWindow())
return;
UpdateIsInternalDisplay();
+
+ // We have to enable Tap-to-click by default because the cursor is set to
+ // visible in Shell::InitRootWindowController.
mazda 2013/06/28 16:08:43 Should this be inside #if defined(OS_CHROMEOS)?
Shecky Lin 2013/07/01 04:34:36 Done.
+ SetCrOSTapPaused(false);
}
bool RootWindowHostX11::DispatchEventForRootWindow(
@@ -1088,6 +1070,33 @@ void RootWindowHostX11::UpdateIsInternalDisplay() {
is_internal_display_ = display.IsInternal();
}
+void RootWindowHostX11::SetCrOSTapPaused(bool state) {
+ LOG(ERROR) << "RootWindowHostX11::SetCrOSTapPaused";
mazda 2013/06/28 16:08:43 Is this debug code?
Shecky Lin 2013/07/01 04:34:36 Oops, sorry. 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