diff options
author | Vaxry <[email protected]> | 2023-10-30 00:18:40 +0000 |
---|---|---|
committer | Vaxry <[email protected]> | 2023-10-30 00:18:40 +0000 |
commit | 8e91c038db0f512e5bfe84711ee1a1345055d7a3 (patch) | |
tree | 91e06d57db9a1cca47e510bf93e32f2ee4097a44 | |
parent | 86318ce04f59295175bd3eabedaf5e0f4fa2cc1e (diff) | |
download | Hyprland-8e91c038db0f512e5bfe84711ee1a1345055d7a3.tar.gz Hyprland-8e91c038db0f512e5bfe84711ee1a1345055d7a3.zip |
renderer: use optional for cursor surface storing
because nullptr is a valid surface.
fixes #3692
-rw-r--r-- | src/render/Renderer.cpp | 2 | ||||
-rw-r--r-- | src/render/Renderer.hpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index f202c2c5..927c589d 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -1956,7 +1956,7 @@ void CHyprRenderer::setCursorFromName(const std::string& name) { return; m_sLastCursorData.name = name; - m_sLastCursorData.surf = nullptr; + m_sLastCursorData.surf.reset(); wlr_cursor_set_xcursor(g_pCompositor->m_sWLRCursor, g_pCompositor->m_sWLRXCursorMgr, name.c_str()); } diff --git a/src/render/Renderer.hpp b/src/render/Renderer.hpp index 859d1d6a..0281d33f 100644 --- a/src/render/Renderer.hpp +++ b/src/render/Renderer.hpp @@ -84,8 +84,8 @@ class CHyprRenderer { CTimer m_tRenderTimer; struct { - wlr_surface* surf = nullptr; - std::string name; + std::optional<wlr_surface*> surf = nullptr; + std::string name; } m_sLastCursorData; private: |