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

Unified Diff: ash/host/ash_window_tree_host_x11.cc

Issue 922843002: Fix software mirror mode on Ozone part 2/2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « ash/host/ash_window_tree_host_x11.h ('k') | ash/touch/touch_transformer_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/host/ash_window_tree_host_x11.cc
diff --git a/ash/host/ash_window_tree_host_x11.cc b/ash/host/ash_window_tree_host_x11.cc
index 7fca1e7a256a2451118e172515a5c9d2b361b0a4..882ef13409b01a0ddfaca88b6412efdec2f3bc5e 100644
--- a/ash/host/ash_window_tree_host_x11.cc
+++ b/ash/host/ash_window_tree_host_x11.cc
@@ -33,10 +33,7 @@
namespace ash {
AshWindowTreeHostX11::AshWindowTreeHostX11(const gfx::Rect& initial_bounds)
- : WindowTreeHostX11(initial_bounds),
- transformer_helper_(this),
- display_ids_(std::make_pair(gfx::Display::kInvalidDisplayID,
- gfx::Display::kInvalidDisplayID)) {
+ : WindowTreeHostX11(initial_bounds), transformer_helper_(this) {
aura::Env::GetInstance()->AddObserver(this);
}
@@ -126,11 +123,6 @@ gfx::Insets AshWindowTreeHostX11::GetHostInsets() const {
aura::WindowTreeHost* AshWindowTreeHostX11::AsWindowTreeHost() { return this; }
-void AshWindowTreeHostX11::UpdateDisplayID(int64 id1, int64 id2) {
- display_ids_.first = id1;
- display_ids_.second = id2;
-}
-
void AshWindowTreeHostX11::PrepareForShutdown() {
// Block the root window from dispatching events because it is weird for a
// ScreenPositionClient not to be attached to the root window and for
@@ -213,7 +205,7 @@ bool AshWindowTreeHostX11::CanDispatchEvent(const ui::PlatformEvent& event) {
#if defined(OS_CHROMEOS)
XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(xev->xcookie.data);
int64 touch_display_id =
- ui::DeviceDataManager::GetInstance()->GetDisplayForTouchDevice(
+ ui::DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice(
xiev->deviceid);
// If we don't have record of display id for this touch device, check
// that if the event is within the bound of the root window. Note
@@ -223,9 +215,10 @@ bool AshWindowTreeHostX11::CanDispatchEvent(const ui::PlatformEvent& event) {
if (base::SysInfo::IsRunningOnChromeOS() &&
!bounds().Contains(ui::EventLocationFromNative(xev)))
return false;
- } else if (touch_display_id != display_ids_.first &&
- touch_display_id != display_ids_.second) {
- return false;
+ } else {
+ gfx::Screen* screen = gfx::Screen::GetScreenFor(window());
+ gfx::Display display = screen->GetDisplayNearestWindow(window());
+ return touch_display_id == display.id();
}
#endif // defined(OS_CHROMEOS)
return true;
« no previous file with comments | « ash/host/ash_window_tree_host_x11.h ('k') | ash/touch/touch_transformer_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698