HookSystem: improve callback safety
This commit is contained in:
parent
1055e6bee6
commit
4ad739ec63
18 changed files with 89 additions and 105 deletions
|
|
@ -52,7 +52,7 @@ CHyprOpenGLImpl::CHyprOpenGLImpl() {
|
|||
Debug::log(WARN, "!RENDERER: Using the legacy GLES2 renderer!");
|
||||
#endif
|
||||
|
||||
g_pHookSystem->hookDynamic("preRender", [&](void* self, SCallbackInfo& info, std::any data) { preRender(std::any_cast<CMonitor*>(data)); });
|
||||
static auto P = g_pHookSystem->hookDynamic("preRender", [&](void* self, SCallbackInfo& info, std::any data) { preRender(std::any_cast<CMonitor*>(data)); });
|
||||
|
||||
RASSERT(eglMakeCurrent(wlr_egl_get_display(g_pCompositor->m_sWLREGL), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT), "Couldn't unset current EGL!");
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ CHyprRenderer::CHyprRenderer() {
|
|||
|
||||
// cursor hiding stuff
|
||||
|
||||
g_pHookSystem->hookDynamic("keyPress", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
static auto P = g_pHookSystem->hookDynamic("keyPress", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
if (m_sCursorHiddenConditions.hiddenOnKeyboard)
|
||||
return;
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ CHyprRenderer::CHyprRenderer() {
|
|||
ensureCursorRenderingMode();
|
||||
});
|
||||
|
||||
g_pHookSystem->hookDynamic("mouseMove", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
static auto P2 = g_pHookSystem->hookDynamic("mouseMove", [&](void* self, SCallbackInfo& info, std::any param) {
|
||||
if (!m_sCursorHiddenConditions.hiddenOnKeyboard && m_sCursorHiddenConditions.hiddenOnTouch == g_pInputManager->m_bLastInputTouch &&
|
||||
!m_sCursorHiddenConditions.hiddenOnTimeout)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
#include "../../Compositor.hpp"
|
||||
|
||||
CDecorationPositioner::CDecorationPositioner() {
|
||||
g_pHookSystem->hookDynamic("closeWindow", [this](void* call, SCallbackInfo& info, std::any data) {
|
||||
static auto P = g_pHookSystem->hookDynamic("closeWindow", [this](void* call, SCallbackInfo& info, std::any data) {
|
||||
auto* const PWINDOW = std::any_cast<CWindow*>(data);
|
||||
this->onWindowUnmap(PWINDOW);
|
||||
});
|
||||
|
||||
g_pHookSystem->hookDynamic("openWindow", [this](void* call, SCallbackInfo& info, std::any data) {
|
||||
static auto P2 = g_pHookSystem->hookDynamic("openWindow", [this](void* call, SCallbackInfo& info, std::any data) {
|
||||
auto* const PWINDOW = std::any_cast<CWindow*>(data);
|
||||
this->onWindowMap(PWINDOW);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue