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

Unified Diff: ui/ozone/platform/dri/dri_cursor.cc

Issue 566953002: [Ozone-DRI] Fix cursor showing on wrong monitor after display changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « ui/ozone/platform/dri/dri_cursor.h ('k') | ui/ozone/platform/dri/dri_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_cursor.cc
diff --git a/ui/ozone/platform/dri/dri_cursor.cc b/ui/ozone/platform/dri/dri_cursor.cc
index a7b5fba7109768f8d15dec3fb71d24f1fad1b615..a6fe5fe0f71f8f8091cf1f1788d30410430df571 100644
--- a/ui/ozone/platform/dri/dri_cursor.cc
+++ b/ui/ozone/platform/dri/dri_cursor.cc
@@ -27,23 +27,32 @@ void DriCursor::SetCursor(gfx::AcceleratedWidget widget,
PlatformCursor platform_cursor) {
scoped_refptr<BitmapCursorOzone> cursor =
BitmapCursorFactoryOzone::GetBitmapCursor(platform_cursor);
- if (cursor_ == cursor)
+ if (cursor_ == cursor || cursor_window_ != widget)
return;
cursor_ = cursor;
- if (cursor_.get())
+ ShowCursor();
+}
+
+void DriCursor::ShowCursor() {
+ if (cursor_.get())
hardware_->SetHardwareCursor(cursor_window_,
cursor_->bitmaps(),
bitmap_location(),
cursor_->frame_delay_ms());
else
- UnsetCursor(cursor_window_);
+ HideCursor();
+}
+
+void DriCursor::HideCursor() {
+ hardware_->SetHardwareCursor(
+ cursor_window_, std::vector<SkBitmap>(), gfx::Point(), 0);
}
void DriCursor::MoveCursorTo(gfx::AcceleratedWidget widget,
const gfx::PointF& location) {
if (widget != cursor_window_)
- UnsetCursor(cursor_window_);
+ HideCursor();
cursor_window_ = widget;
cursor_location_ = location;
@@ -77,9 +86,4 @@ gfx::Point DriCursor::bitmap_location() {
cursor_->hotspot().OffsetFromOrigin();
}
-void DriCursor::UnsetCursor(gfx::AcceleratedWidget widget) {
- hardware_->SetHardwareCursor(
- widget, std::vector<SkBitmap>(), gfx::Point(), 0);
-}
-
} // namespace ui
« no previous file with comments | « ui/ozone/platform/dri/dri_cursor.h ('k') | ui/ozone/platform/dri/dri_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698