Commit 34527322 authored by Shivam Balikondwar's avatar Shivam Balikondwar Committed by Commit Bot

ozone/wayland: Fix hiding cursor when playing media in fullscreen.

When using Chromium on Wayland, the cursor doesn't become invisible
whenever user enters fullscreen mode while watching any videos
(Eg. Youtube).

This patch fixes that feature.

Bug: 895743
Change-Id: Ic66c5342f63c374586855691ba395f33d4a49446
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2060431Reviewed-by: default avatarMaksim Sisov <msisov@igalia.com>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#744560}
parent 7a15fe49
...@@ -35,6 +35,8 @@ void WaylandCursor::Init(wl_pointer* pointer, WaylandConnection* connection) { ...@@ -35,6 +35,8 @@ void WaylandCursor::Init(wl_pointer* pointer, WaylandConnection* connection) {
shm_ = connection->shm(); shm_ = connection->shm();
pointer_surface_.reset( pointer_surface_.reset(
wl_compositor_create_surface(connection->compositor())); wl_compositor_create_surface(connection->compositor()));
connection_ = connection;
} }
void WaylandCursor::UpdateBitmap(const std::vector<SkBitmap>& cursor_image, void WaylandCursor::UpdateBitmap(const std::vector<SkBitmap>& cursor_image,
...@@ -79,6 +81,11 @@ void WaylandCursor::UpdateBitmap(const std::vector<SkBitmap>& cursor_image, ...@@ -79,6 +81,11 @@ void WaylandCursor::UpdateBitmap(const std::vector<SkBitmap>& cursor_image,
void WaylandCursor::HideCursor(uint32_t serial) { void WaylandCursor::HideCursor(uint32_t serial) {
DCHECK(input_pointer_); DCHECK(input_pointer_);
wl_pointer_set_cursor(input_pointer_, serial, nullptr, 0, 0); wl_pointer_set_cursor(input_pointer_, serial, nullptr, 0, 0);
wl_surface_attach(pointer_surface_.get(), nullptr, 0, 0);
wl_surface_commit(pointer_surface_.get());
connection_->ScheduleFlush();
} }
} // namespace ui } // namespace ui
...@@ -57,6 +57,7 @@ class WaylandCursor { ...@@ -57,6 +57,7 @@ class WaylandCursor {
WaylandShm* shm_ = nullptr; // Owned by WaylandConnection. WaylandShm* shm_ = nullptr; // Owned by WaylandConnection.
wl_pointer* input_pointer_ = nullptr; // Owned by WaylandPointer. wl_pointer* input_pointer_ = nullptr; // Owned by WaylandPointer.
WaylandConnection* connection_ = nullptr;
// Holds the buffers and their memory until the compositor releases them. // Holds the buffers and their memory until the compositor releases them.
base::flat_map<wl_buffer*, WaylandShmBuffer> buffers_; base::flat_map<wl_buffer*, WaylandShmBuffer> buffers_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment