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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc

Issue 1423703002: Don't drop the floating point part of events when converting types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/views/widget/desktop_aura/desktop_window_tree_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xregion.h> 10 #include <X11/Xregion.h>
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 DesktopWindowTreeHostX11* host) { 1529 DesktopWindowTreeHostX11* host) {
1530 DCHECK_NE(this, host); 1530 DCHECK_NE(this, host);
1531 const gfx::Display display_src = 1531 const gfx::Display display_src =
1532 gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow(window()); 1532 gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow(window());
1533 const gfx::Display display_dest = 1533 const gfx::Display display_dest =
1534 gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow(host->window()); 1534 gfx::Screen::GetNativeScreen()->GetDisplayNearestWindow(host->window());
1535 DCHECK_EQ(display_src.device_scale_factor(), 1535 DCHECK_EQ(display_src.device_scale_factor(),
1536 display_dest.device_scale_factor()); 1536 display_dest.device_scale_factor());
1537 gfx::Vector2d offset = GetLocationOnNativeScreen() - 1537 gfx::Vector2d offset = GetLocationOnNativeScreen() -
1538 host->GetLocationOnNativeScreen(); 1538 host->GetLocationOnNativeScreen();
1539 gfx::Point location_in_pixel_in_host = located_event->location() + offset; 1539 gfx::PointF location_in_pixel_in_host =
1540 located_event->location_f() + gfx::Vector2dF(offset);
1540 located_event->set_location(location_in_pixel_in_host); 1541 located_event->set_location(location_in_pixel_in_host);
1541 } 1542 }
1542 1543
1543 void DesktopWindowTreeHostX11::ResetWindowRegion() { 1544 void DesktopWindowTreeHostX11::ResetWindowRegion() {
1544 // If a custom window shape was supplied then apply it. 1545 // If a custom window shape was supplied then apply it.
1545 if (custom_window_shape_) { 1546 if (custom_window_shape_) {
1546 XShapeCombineRegion(xdisplay_, xwindow_, ShapeBounding, 0, 0, 1547 XShapeCombineRegion(xdisplay_, xwindow_, ShapeBounding, 0, 0,
1547 window_shape_.get(), false); 1548 window_shape_.get(), false);
1548 return; 1549 return;
1549 } 1550 }
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 if (linux_ui) { 2058 if (linux_ui) {
2058 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 2059 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
2059 if (native_theme) 2060 if (native_theme)
2060 return native_theme; 2061 return native_theme;
2061 } 2062 }
2062 2063
2063 return ui::NativeTheme::instance(); 2064 return ui::NativeTheme::instance();
2064 } 2065 }
2065 2066
2066 } // namespace views 2067 } // namespace views
OLDNEW
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698