mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 23:51:55 -07:00
cursor: add hyprcursor loggers
This commit is contained in:
@@ -109,7 +109,7 @@ pkg_check_modules(deps REQUIRED IMPORTED_TARGET
|
||||
wayland-server wayland-client wayland-cursor wayland-protocols
|
||||
cairo pango pangocairo pixman-1
|
||||
libdrm libinput hwdata libseat libdisplay-info libliftoff libudev gbm
|
||||
hyprlang>=0.3.2 hyprcursor
|
||||
hyprlang>=0.3.2 hyprcursor>=0.1.7
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp")
|
||||
|
@@ -12,8 +12,15 @@ static int cursorAnimTimer(void* data) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void hcLogger(enum eHyprcursorLogLevel level, char* message) {
|
||||
if (level == HC_LOG_TRACE)
|
||||
return;
|
||||
|
||||
Debug::log(NONE, "[hc] {}", message);
|
||||
}
|
||||
|
||||
CCursorManager::CCursorManager() {
|
||||
m_pHyprcursor = std::make_unique<Hyprcursor::CHyprcursorManager>(m_szTheme.empty() ? nullptr : m_szTheme.c_str());
|
||||
m_pHyprcursor = std::make_unique<Hyprcursor::CHyprcursorManager>(m_szTheme.empty() ? nullptr : m_szTheme.c_str(), hcLogger);
|
||||
|
||||
if (!m_pHyprcursor->valid())
|
||||
Debug::log(ERR, "Hyprcursor failed loading theme \"{}\", falling back to X.", m_szTheme);
|
||||
@@ -224,7 +231,7 @@ void CCursorManager::updateTheme() {
|
||||
}
|
||||
|
||||
void CCursorManager::changeTheme(const std::string& name, const int size) {
|
||||
m_pHyprcursor = std::make_unique<Hyprcursor::CHyprcursorManager>(name.empty() ? "" : name.c_str());
|
||||
m_pHyprcursor = std::make_unique<Hyprcursor::CHyprcursorManager>(name.empty() ? "" : name.c_str(), hcLogger);
|
||||
m_szTheme = name;
|
||||
m_iSize = size;
|
||||
|
||||
|
Reference in New Issue
Block a user