don't load cursor theme if already loaded

This commit is contained in:
Vaxry 2022-12-28 23:26:58 +01:00
parent 60013ee655
commit aefd63876d

View file

@ -28,7 +28,6 @@ void CHyprpaper::init() {
while (wl_display_dispatch(m_sDisplay) != -1) {
tick(true);
}
}
void CHyprpaper::tick(bool force) {
@ -135,6 +134,7 @@ void CHyprpaper::recheckMonitor(SMonitor* pMonitor) {
pMonitor->wantsACK = false;
zwlr_layer_surface_v1_ack_configure(pMonitor->pCurrentLayerSurface->pLayerSurface, pMonitor->configureSerial);
if (!pMonitor->pCurrentLayerSurface->pCursorImg) {
int XCURSOR_SIZE = 24;
if (const auto CURSORSIZENV = getenv("XCURSOR_SIZE"); CURSORSIZENV) {
try {
@ -146,9 +146,9 @@ void CHyprpaper::recheckMonitor(SMonitor* pMonitor) {
XCURSOR_SIZE = 24;
}
}
pMonitor->pCurrentLayerSurface->pCursorImg = wl_cursor_theme_get_cursor(wl_cursor_theme_load(getenv("XCURSOR_THEME"), XCURSOR_SIZE * pMonitor->scale, m_sSHM), "left_ptr")->images[0];
}
}
if (pMonitor->wantsReload) {
pMonitor->wantsReload = false;