From 02471970aad1fb7d90662f2dc3cf2f38a52ac97b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:34:04 +0200 Subject: [PATCH] guard XCURSOR_SIZE --- src/hyprpicker.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hyprpicker.cpp b/src/hyprpicker.cpp index 6590a4c..ecb30cb 100644 --- a/src/hyprpicker.cpp +++ b/src/hyprpicker.cpp @@ -55,7 +55,12 @@ void CHyprpicker::recheckACK() { createBuffer(&ls->buffers[0], ls->m_pMonitor->size.x * ls->m_pMonitor->scale, ls->m_pMonitor->size.y * ls->m_pMonitor->scale, WL_SHM_FORMAT_ARGB8888); createBuffer(&ls->buffers[1], ls->m_pMonitor->size.x * ls->m_pMonitor->scale, ls->m_pMonitor->size.y * ls->m_pMonitor->scale, WL_SHM_FORMAT_ARGB8888); - ls->pCursorImg = wl_cursor_theme_get_cursor(wl_cursor_theme_load(getenv("XCURSOR_THEME"), std::stoi(getenv("XCURSOR_SIZE")) * ls->m_pMonitor->scale, m_pWLSHM), "left_ptr")->images[0]; + int XCURSOR_SIZE = 24; + if (getenv("XCURSOR_SIZE")) { + XCURSOR_SIZE = std::stoi(getenv("XCURSOR_SIZE")); + } + + ls->pCursorImg = wl_cursor_theme_get_cursor(wl_cursor_theme_load(getenv("XCURSOR_THEME"), XCURSOR_SIZE * ls->m_pMonitor->scale, m_pWLSHM), "left_ptr")->images[0]; } } }