diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp index db274e3c..4170d4dd 100644 --- a/src/protocols/XDGShell.cpp +++ b/src/protocols/XDGShell.cpp @@ -319,8 +319,11 @@ uint32_t CXDGToplevelResource::setSuspeneded(bool sus) { void CXDGToplevelResource::applyState() { wl_array arr; wl_array_init(&arr); - wl_array_add(&arr, pendingApply.states.size() * sizeof(int)); - memcpy(arr.data, pendingApply.states.data(), pendingApply.states.size() * sizeof(int)); + + if (!pendingApply.states.empty()) { + wl_array_add(&arr, pendingApply.states.size() * sizeof(int)); + memcpy(arr.data, pendingApply.states.data(), pendingApply.states.size() * sizeof(int)); + } resource->sendConfigure(pendingApply.size.x, pendingApply.size.y, &arr); diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 2a96f1b7..675955ee 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -3021,7 +3021,7 @@ CEGLSync::~CEGLSync() { if (sync == EGL_NO_SYNC_KHR) return; - if (g_pHyprOpenGL->m_sProc.eglDestroySyncKHR(g_pHyprOpenGL->m_pEglDisplay, sync) != EGL_TRUE) + if (g_pHyprOpenGL && g_pHyprOpenGL->m_sProc.eglDestroySyncKHR(g_pHyprOpenGL->m_pEglDisplay, sync) != EGL_TRUE) Debug::log(ERR, "eglDestroySyncKHR failed"); }