mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-11-16 23:05:58 +01:00
config: allow mon description for monitor
value (#216)
* config: allow mon description for `monitor` value * rename field
This commit is contained in:
parent
230f8aadb5
commit
2448774de3
4 changed files with 10 additions and 7 deletions
|
@ -47,7 +47,8 @@ static void handleName(void* data, wl_output* output, const char* name) {
|
||||||
|
|
||||||
static void handleDescription(void* data, wl_output* output, const char* description) {
|
static void handleDescription(void* data, wl_output* output, const char* description) {
|
||||||
const auto POUTPUT = (COutput*)data;
|
const auto POUTPUT = (COutput*)data;
|
||||||
Debug::log(LOG, "output {} description {}", POUTPUT->name, description ? description : "");
|
POUTPUT->stringDesc = description ? std::string{description} : "";
|
||||||
|
Debug::log(LOG, "output {} description {}", POUTPUT->name, POUTPUT->stringDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const wl_output_listener outputListener = {
|
static const wl_output_listener outputListener = {
|
||||||
|
|
|
@ -16,6 +16,7 @@ class COutput {
|
||||||
int scale = 1;
|
int scale = 1;
|
||||||
std::string stringName = "";
|
std::string stringName = "";
|
||||||
std::string stringPort = "";
|
std::string stringPort = "";
|
||||||
|
std::string stringDesc = "";
|
||||||
|
|
||||||
std::unique_ptr<CSessionLockSurface> sessionLockSurface;
|
std::unique_ptr<CSessionLockSurface> sessionLockSurface;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,8 @@ CAsyncResourceGatherer::CAsyncResourceGatherer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& mon : mons) {
|
for (auto& mon : mons) {
|
||||||
const auto MON = std::find_if(g_pHyprlock->m_vOutputs.begin(), g_pHyprlock->m_vOutputs.end(), [mon](const auto& other) { return other->stringPort == mon; });
|
const auto MON = std::find_if(g_pHyprlock->m_vOutputs.begin(), g_pHyprlock->m_vOutputs.end(),
|
||||||
|
[mon](const auto& other) { return other->stringPort == mon || other->stringDesc.starts_with(mon); });
|
||||||
|
|
||||||
if (MON == g_pHyprlock->m_vOutputs.end())
|
if (MON == g_pHyprlock->m_vOutputs.end())
|
||||||
continue;
|
continue;
|
||||||
|
@ -65,7 +66,7 @@ void CAsyncResourceGatherer::recheckDMAFramesFor(COutput* output) {
|
||||||
if (std::string{std::any_cast<Hyprlang::STRING>(c.values.at("path"))} != "screenshot")
|
if (std::string{std::any_cast<Hyprlang::STRING>(c.values.at("path"))} != "screenshot")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (c.monitor.empty() || c.monitor == output->stringPort) {
|
if (c.monitor.empty() || c.monitor == output->stringPort || output->stringDesc.starts_with(c.monitor)) {
|
||||||
shouldMake = true;
|
shouldMake = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,7 +306,7 @@ std::vector<std::unique_ptr<IWidget>>* CRenderer::getOrCreateWidgetsFor(const CS
|
||||||
const auto CWIDGETS = g_pConfigManager->getWidgetConfigs();
|
const auto CWIDGETS = g_pConfigManager->getWidgetConfigs();
|
||||||
|
|
||||||
for (auto& c : CWIDGETS) {
|
for (auto& c : CWIDGETS) {
|
||||||
if (!c.monitor.empty() && c.monitor != surf->output->stringPort)
|
if (!c.monitor.empty() && c.monitor != surf->output->stringPort && !surf->output->stringDesc.starts_with(c.monitor))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// by type
|
// by type
|
||||||
|
|
Loading…
Reference in a new issue