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

Side by Side Diff: ui/aura/window_tree_host_x11.cc

Issue 1421713002: Explicitly convert Point to PointF for event code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wip
Patch Set: pointfconvert-prod: . Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698