You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chromium/chromium-115-wayland-load_d...

32 lines
1.6 KiB

commit 8f46ad499d8f8afd56bf5c82cbbcad67285ed8aa
Author: Phan Quang Minh <phanquangminh217@gmail.com>
Date: Wed May 24 10:13:45 2023 +0000
ozone/wayland: Load default cursor theme if theme name is empty
We might need to load the cursor theme even if `OnCursorThemeName` never
gets called (e.g. Qt theme backend). In this case we will need to load
the default theme by passing `NULL` to wl_cursor_theme_load.
Change-Id: I0e1814178319734a4d0fe7574cdc8c7a1d1cf7a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4553659
Reviewed-by: Antonio Gomes <tonikitoo@igalia.com>
Reviewed-by: Maksim Sisov <msisov@igalia.com>
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1148441}
diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc b/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc
index 9ab12b1994c68..11b162554abc8 100644
--- a/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc
+++ b/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc
@@ -230,7 +230,8 @@ void WaylandCursorFactory::MaybeLoadThemeCursors() {
base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE,
{base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
- base::BindOnce(wl_cursor_theme_load, name_.c_str(), GetCacheKey(),
+ base::BindOnce(wl_cursor_theme_load,
+ name_.empty() ? nullptr : name_.c_str(), GetCacheKey(),
connection_->buffer_factory()->shm()),
base::BindOnce(&WaylandCursorFactory::OnThemeLoaded,
weak_factory_.GetWeakPtr(), name_, size_));