mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-11-16 22:25:59 +01:00
Merge pull request #24 from vilari-mickopf/main
fix crash when XCURSOR_SIZE environment variable is set incorrectly
This commit is contained in:
commit
60013ee655
1 changed files with 13 additions and 6 deletions
|
@ -136,8 +136,15 @@ void CHyprpaper::recheckMonitor(SMonitor* pMonitor) {
|
|||
zwlr_layer_surface_v1_ack_configure(pMonitor->pCurrentLayerSurface->pLayerSurface, pMonitor->configureSerial);
|
||||
|
||||
int XCURSOR_SIZE = 24;
|
||||
if (getenv("XCURSOR_SIZE")) {
|
||||
XCURSOR_SIZE = std::stoi(getenv("XCURSOR_SIZE"));
|
||||
if (const auto CURSORSIZENV = getenv("XCURSOR_SIZE"); CURSORSIZENV) {
|
||||
try {
|
||||
if (XCURSOR_SIZE = std::stoi(CURSORSIZENV); XCURSOR_SIZE <= 0) {
|
||||
throw std::exception();
|
||||
}
|
||||
} catch (...) {
|
||||
Debug::log(WARN, "XCURSOR_SIZE environment variable is set incorrectly");
|
||||
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];
|
||||
|
|
Loading…
Reference in a new issue