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/ozone/platform/dri/dri_window_manager.cc

Issue 766583002: ozone: dri: Support moving between displays in MoveCursorTo(location) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ozone/platform/dri/dri_window_manager.h" 5 #include "ui/ozone/platform/dri/dri_window_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/ozone/platform/dri/dri_cursor.h" 8 #include "ui/ozone/platform/dri/dri_cursor.h"
9 #include "ui/ozone/platform/dri/dri_window.h" 9 #include "ui/ozone/platform/dri/dri_window.h"
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 DriWindow* DriWindowManager::GetWindow(gfx::AcceleratedWidget widget) { 56 DriWindow* DriWindowManager::GetWindow(gfx::AcceleratedWidget widget) {
57 WidgetToWindowMap::iterator it = window_map_.find(widget); 57 WidgetToWindowMap::iterator it = window_map_.find(widget);
58 if (it != window_map_.end()) 58 if (it != window_map_.end())
59 return it->second; 59 return it->second;
60 60
61 NOTREACHED() << "Attempting to get non-existing window " << widget; 61 NOTREACHED() << "Attempting to get non-existing window " << widget;
62 return NULL; 62 return NULL;
63 } 63 }
64 64
65 DriWindow* DriWindowManager::GetWindowAt(const gfx::Point& location) {
66 for (auto it = window_map_.begin(); it != window_map_.end(); ++it)
67 if (it->second->GetBounds().Contains(location))
68 return it->second;
69
70 return NULL;
71 }
72
65 void DriWindowManager::ResetCursorLocation() { 73 void DriWindowManager::ResetCursorLocation() {
66 gfx::AcceleratedWidget cursor_widget = gfx::kNullAcceleratedWidget; 74 gfx::AcceleratedWidget cursor_widget = gfx::kNullAcceleratedWidget;
67 gfx::PointF location; 75 gfx::PointF location;
68 if (!window_map_.empty()) { 76 if (!window_map_.empty()) {
69 WidgetToWindowMap::iterator it = window_map_.begin(); 77 WidgetToWindowMap::iterator it = window_map_.begin();
70 cursor_widget = it->first; 78 cursor_widget = it->first;
71 location = GetDefaultCursorLocation(it->second); 79 location = GetDefaultCursorLocation(it->second);
72 } 80 }
73 81
74 cursor_->MoveCursorTo(cursor_widget, location); 82 cursor_->MoveCursorTo(cursor_widget, location);
75 } 83 }
76 84
77 } // namespace ui 85 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_window_manager.h ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698