Remove prefix newlines from demangled func name

The demangled function names from HyprlandAPI::findFunctionsByName were
originally always returning a string prefixed with a newline character.
This was fixed in Hyprland since
1afb00a01b
so the newline char can now be removed.
This commit is contained in:
ItsDrike 2023-10-05 14:35:11 +02:00
parent 54cf7c6989
commit 66f03d3a08
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0

View file

@ -33,9 +33,9 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle)
Debug::log(LOG, "[dwindle-autogroup] Loading Hyprland functions");
// Find pointers to functions by name (from the Hyprland binary)
g_pNodeFromWindow = (nodeFromWindowFuncT)findHyprlandFunction("getNodeFromWindow", "\nCHyprDwindleLayout::getNodeFromWindow(CWindow*)");
auto pCreateGroup = findHyprlandFunction("createGroup", "\nCWindow::createGroup()");
auto pDestroyGroup = findHyprlandFunction("destroyGroup", "\nCWindow::destroyGroup()");
g_pNodeFromWindow = (nodeFromWindowFuncT)findHyprlandFunction("getNodeFromWindow", "CHyprDwindleLayout::getNodeFromWindow(CWindow*)");
auto pCreateGroup = findHyprlandFunction("createGroup", "CWindow::createGroup()");
auto pDestroyGroup = findHyprlandFunction("destroyGroup", "CWindow::destroyGroup()");
// Return immediately if one of the functions wasn't found
if (!g_pNodeFromWindow || !pCreateGroup || !pDestroyGroup) {