mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2024-11-17 00:25:57 +01:00
parent
8a7799ae20
commit
b6130e3901
2 changed files with 13 additions and 3 deletions
|
@ -96,6 +96,9 @@ void Events::handlePointerEnter(void* data, struct wl_pointer* wl_pointer, uint3
|
||||||
if (ls->pSurface == surface) {
|
if (ls->pSurface == surface) {
|
||||||
g_pHyprpicker->m_pLastSurface = ls.get();
|
g_pHyprpicker->m_pLastSurface = ls.get();
|
||||||
|
|
||||||
|
if (!ls->pCursorImg)
|
||||||
|
break;
|
||||||
|
|
||||||
wl_surface_set_buffer_scale(ls->pCursorSurface, ls->m_pMonitor->scale);
|
wl_surface_set_buffer_scale(ls->pCursorSurface, ls->m_pMonitor->scale);
|
||||||
wl_surface_attach(ls->pCursorSurface, wl_cursor_image_get_buffer(ls->pCursorImg), 0, 0);
|
wl_surface_attach(ls->pCursorSurface, wl_cursor_image_get_buffer(ls->pCursorImg), 0, 0);
|
||||||
wl_pointer_set_cursor(wl_pointer, serial, ls->pCursorSurface, ls->pCursorImg->hotspot_x / ls->m_pMonitor->scale, ls->pCursorImg->hotspot_y / ls->m_pMonitor->scale);
|
wl_pointer_set_cursor(wl_pointer, serial, ls->pCursorSurface, ls->pCursorImg->hotspot_x / ls->m_pMonitor->scale, ls->pCursorImg->hotspot_y / ls->m_pMonitor->scale);
|
||||||
|
|
|
@ -80,7 +80,14 @@ void CHyprpicker::recheckACK() {
|
||||||
XCURSOR_SIZE = std::stoi(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), "crosshair")->images[0];
|
const auto THEME = wl_cursor_theme_load(getenv("XCURSOR_THEME"), XCURSOR_SIZE * ls->m_pMonitor->scale, m_pWLSHM);
|
||||||
|
auto cursor = wl_cursor_theme_get_cursor(THEME, "crosshair");
|
||||||
|
|
||||||
|
if (!cursor)
|
||||||
|
cursor = wl_cursor_theme_get_cursor(THEME, "left_ptr");
|
||||||
|
|
||||||
|
if (cursor)
|
||||||
|
ls->pCursorImg = cursor->images[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue