internal: destroy cursor theme on LS destroy

This commit is contained in:
vaxerski 2023-04-16 14:07:33 +01:00
parent 10fd31a544
commit 3bfaac09f5
3 changed files with 8 additions and 1 deletions

View File

@ -146,7 +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];
pMonitor->pCurrentLayerSurface->pCursorTheme = wl_cursor_theme_load(getenv("XCURSOR_THEME"), XCURSOR_SIZE * pMonitor->scale, m_sSHM);
pMonitor->pCurrentLayerSurface->pCursorImg = wl_cursor_theme_get_cursor(pMonitor->pCurrentLayerSurface->pCursorTheme, "left_ptr")->images[0];
}
}

View File

@ -49,6 +49,10 @@ CLayerSurface::CLayerSurface(SMonitor* pMonitor) {
}
CLayerSurface::~CLayerSurface() {
if (pCursorTheme)
wl_cursor_theme_destroy(pCursorTheme);
if (g_pHyprpaper->m_sFractionalScale && pFractionalScaleInfo) {
wp_fractional_scale_v1_destroy(pFractionalScaleInfo);

View File

@ -14,6 +14,7 @@ public:
zwlr_layer_surface_v1* pLayerSurface = nullptr;
wl_surface* pSurface = nullptr;
wl_cursor_theme* pCursorTheme = nullptr;
wl_cursor_image* pCursorImg = nullptr;
wl_surface* pCursorSurface = nullptr;