| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/window_tree_host_x11.h" | 5 #include "ui/aura/window_tree_host_x11.h" |
| 6 | 6 |
| 7 #include <strings.h> | 7 #include <strings.h> |
| 8 #include <X11/cursorfont.h> | 8 #include <X11/cursorfont.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // When there is a top bezel we add our border, | 162 // When there is a top bezel we add our border, |
| 163 y -= top_; | 163 y -= top_; |
| 164 // Scale the screen area back to the full resolution of the screen. | 164 // Scale the screen area back to the full resolution of the screen. |
| 165 y = (y * resolution_y) / (resolution_y - (bottom_ + top_)); | 165 y = (y * resolution_y) / (resolution_y - (bottom_ + top_)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 // Set the modified coordinate back to the event. | 168 // Set the modified coordinate back to the event. |
| 169 if (event->root_location() == event->location()) { | 169 if (event->root_location() == event->location()) { |
| 170 // Usually those will be equal, | 170 // Usually those will be equal, |
| 171 // if not, I am not sure what the correct value should be. | 171 // if not, I am not sure what the correct value should be. |
| 172 event->set_root_location(gfx::Point(x, y)); | 172 event->set_root_location(gfx::PointF(x, y)); |
| 173 } | 173 } |
| 174 event->set_location(gfx::Point(x, y)); | 174 event->set_location(gfx::PointF(x, y)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 private: | 177 private: |
| 178 // ui::PlatformEventObserver: | 178 // ui::PlatformEventObserver: |
| 179 void WillProcessEvent(const ui::PlatformEvent& event) override { | 179 void WillProcessEvent(const ui::PlatformEvent& event) override { |
| 180 if (event->type == GenericEvent && | 180 if (event->type == GenericEvent && |
| 181 (event->xgeneric.evtype == XI_TouchBegin || | 181 (event->xgeneric.evtype == XI_TouchBegin || |
| 182 event->xgeneric.evtype == XI_TouchUpdate || | 182 event->xgeneric.evtype == XI_TouchUpdate || |
| 183 event->xgeneric.evtype == XI_TouchEnd)) { | 183 event->xgeneric.evtype == XI_TouchEnd)) { |
| 184 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event->xcookie.data); | 184 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event->xcookie.data); |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 } | 662 } |
| 663 | 663 |
| 664 namespace test { | 664 namespace test { |
| 665 | 665 |
| 666 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 666 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
| 667 default_override_redirect = override_redirect; | 667 default_override_redirect = override_redirect; |
| 668 } | 668 } |
| 669 | 669 |
| 670 } // namespace test | 670 } // namespace test |
| 671 } // namespace aura | 671 } // namespace aura |
| OLD | NEW |