summaryrefslogtreecommitdiff
path: root/src/debug/HyprCtl.cpp
diff options
context:
space:
mode:
authorPaul <leftas@users.noreply.github.com>2022-12-04 19:32:55 +0200
committerGitHub <noreply@github.com>2022-12-04 17:32:55 +0000
commitd9998f2ca5c5f843e7a32b07527d2d90465988a2 (patch)
tree413ccde831c9989dd1a6439a728f0e7b69270b16 /src/debug/HyprCtl.cpp
parent686d6fc6d1ce307e78b050c68aa71ea18449a980 (diff)
Use internal device naming for Hyprctl devices (#1174)
* Use internal naming for Hyprctl devices * Use c-strings rather than std::string
Diffstat (limited to 'src/debug/HyprCtl.cpp')
-rw-r--r--src/debug/HyprCtl.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index 1f0466a2..22cf3fb0 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -289,7 +289,7 @@ R"#( {
"defaultSpeed": %f
},)#",
&m,
- escapeJSONStrings(m.mouse->name).c_str(),
+ escapeJSONStrings(m.name).c_str(),
wlr_input_device_is_libinput(m.mouse) ? libinput_device_config_accel_get_default_speed((libinput_device*)wlr_libinput_get_device_handle(m.mouse)) : 0.f
);
}
@@ -314,7 +314,7 @@ R"#( {
"main": %s
},)#",
&k,
- escapeJSONStrings(k.keyboard->name).c_str(),
+ escapeJSONStrings(k.name).c_str(),
escapeJSONStrings(k.currentRules.rules).c_str(),
escapeJSONStrings(k.currentRules.model).c_str(),
escapeJSONStrings(k.currentRules.layout).c_str(),
@@ -343,7 +343,7 @@ R"#( {
},)#",
&d,
d.pTabletParent,
- escapeJSONStrings(d.pTabletParent ? d.pTabletParent->wlrDevice ? d.pTabletParent->wlrDevice->name : "" : "").c_str()
+ escapeJSONStrings(d.pTabletParent ? d.pTabletParent->name : "").c_str()
);
}
@@ -354,7 +354,7 @@ R"#( {
"name": "%s"
},)#",
&d,
- escapeJSONStrings(d.wlrDevice ? d.wlrDevice->name : "").c_str()
+ escapeJSONStrings(d.name).c_str()
);
}
@@ -383,7 +383,7 @@ R"#( {
"name": "%s"
},)#",
&d,
- d.pWlrDevice ? d.pWlrDevice->name : ""
+ d.name.c_str()
);
}
@@ -416,24 +416,24 @@ R"#( {
result += "mice:\n";
for (auto& m : g_pInputManager->m_lMice) {
- result += getFormat("\tMouse at %x:\n\t\t%s\n\t\t\tdefault speed: %f\n", &m, m.mouse->name, (wlr_input_device_is_libinput(m.mouse) ? libinput_device_config_accel_get_default_speed((libinput_device*)wlr_libinput_get_device_handle(m.mouse)) : 0.f));
+ result += getFormat("\tMouse at %x:\n\t\t%s\n\t\t\tdefault speed: %f\n", &m, m.name.c_str(), (wlr_input_device_is_libinput(m.mouse) ? libinput_device_config_accel_get_default_speed((libinput_device*)wlr_libinput_get_device_handle(m.mouse)) : 0.f));
}
result += "\n\nKeyboards:\n";
for (auto& k : g_pInputManager->m_lKeyboards) {
const auto KM = g_pInputManager->getActiveLayoutForKeyboard(&k);
- result += getFormat("\tKeyboard at %x:\n\t\t%s\n\t\t\trules: r \"%s\", m \"%s\", l \"%s\", v \"%s\", o \"%s\"\n\t\t\tactive keymap: %s\n\t\t\tmain: %s\n", &k, k.keyboard->name, k.currentRules.rules.c_str(), k.currentRules.model.c_str(), k.currentRules.layout.c_str(), k.currentRules.variant.c_str(), k.currentRules.options.c_str(), KM.c_str(), (k.active ? "yes" : "no"));
+ result += getFormat("\tKeyboard at %x:\n\t\t%s\n\t\t\trules: r \"%s\", m \"%s\", l \"%s\", v \"%s\", o \"%s\"\n\t\t\tactive keymap: %s\n\t\t\tmain: %s\n", &k, k.name.c_str(), k.currentRules.rules.c_str(), k.currentRules.model.c_str(), k.currentRules.layout.c_str(), k.currentRules.variant.c_str(), k.currentRules.options.c_str(), KM.c_str(), (k.active ? "yes" : "no"));
}
result += "\n\nTablets:\n";
for (auto& d : g_pInputManager->m_lTabletPads) {
- result += getFormat("\tTablet Pad at %x (belongs to %x -> %s)\n", &d, d.pTabletParent, d.pTabletParent ? d.pTabletParent->wlrDevice ? d.pTabletParent->wlrDevice->name : "" : "");
+ result += getFormat("\tTablet Pad at %x (belongs to %x -> %s)\n", &d, d.pTabletParent, d.pTabletParent ? d.pTabletParent->name.c_str() : "");
}
for (auto& d : g_pInputManager->m_lTablets) {
- result += getFormat("\tTablet at %x:\n\t\t%s\n", &d, d.wlrDevice ? d.wlrDevice->name : "");
+ result += getFormat("\tTablet at %x:\n\t\t%s\n", &d, d.name.c_str());
}
for (auto& d : g_pInputManager->m_lTabletTools) {
@@ -443,7 +443,7 @@ R"#( {
result += "\n\nTouch:\n";
for (auto& d : g_pInputManager->m_lTouchDevices) {
- result += getFormat("\tTouch Device at %x:\n\t\t%s\n", &d, d.pWlrDevice ? d.pWlrDevice->name : "");
+ result += getFormat("\tTouch Device at %x:\n\t\t%s\n", &d, d.name.c_str());
}
result += "\n\nSwitches:\n";