Move to using findFunctionsByName instead of compiler dependant getFunctionAddressFromSignature

This commit is contained in:
ItsDrike 2023-03-31 22:44:26 +02:00
parent 7eca164413
commit 6caef995d1
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -97,9 +97,9 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle)
{
PHANDLE = handle;
// Get address of the private CHyprDwindleLayout::getNodeFromWindow, we'll need it in toggleGroup
g_pNodeFromWindow =
(nodeFromWindowT)HyprlandAPI::getFunctionAddressFromSignature(PHANDLE, "_ZN18CHyprDwindleLayout17getNodeFromWindowEP7CWindow");
// Get address of the private CHyprDwindleLayout::getNodeFromWindow member function, we'll need it in toggleGroup
static const auto METHODS = HyprlandAPI::findFunctionsByName(PHANDLE, "getNodeFromWindow");
g_pNodeFromWindow = (nodeFromWindowT)METHODS[0].address;
originalToggleGroup = g_pKeybindManager->m_mDispatchers["togglegroup"];
HyprlandAPI::addDispatcher(PHANDLE, "togglegroup", toggleGroup);