mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 09:25:59 +01:00
cursor: add hyprcursor loggers
This commit is contained in:
parent
d1c2d524a0
commit
3dbf8e936e
2 changed files with 10 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue