Skip to content

Commit

Permalink
config-backend: fallback to normal [input]
Browse files Browse the repository at this point in the history
  • Loading branch information
ammen99 committed Feb 24, 2025
1 parent 1ffea66 commit c38c595
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/core/plugin.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#include "core-impl.hpp"
#include "wayfire/debug.hpp"
#include "wayfire/output.hpp"
#include "seat/input-manager.hpp"
#include "wayfire/signal-definitions.hpp"
#include <wayfire/nonstd/wlroots-full.hpp>
#include <wayfire/util/log.hpp>
#include <wayfire/config-backend.hpp>
#include <libudev.h>
Expand Down Expand Up @@ -82,18 +79,28 @@ std::shared_ptr<config::section_t> wf::config_backend_t::get_input_device_sectio
std::string name = nonull(device->name);
name = prefix + ":" + name;
LOGC(INPUT_DEVICES, "Checking for config section [", name, "]");
section = config.get_section(name);
if (section)

if (!config.get_section(name))
{
// For input-device:(*) section, we always use per-device sections.
// For input:(*) sections, we fall back to the common [input] section.
if (prefix == "input")
{
LOGC(INPUT_DEVICES, "Using default config section [", prefix, "]");
section = config.get_section(prefix);
} else
{
LOGC(INPUT_DEVICES, "Creating config section [", name, "]");
section = config.get_section(prefix)->clone_with_name(name);
config.merge_section(section);
}
} else
{
LOGC(INPUT_DEVICES, "Using config section [", name, "]");
return section;
section = config.get_section(name);
}

config.merge_section(
config.get_section(prefix)->clone_with_name(name));

LOGC(INPUT_DEVICES, "Using config section [", name, "]");
return config.get_section(name);
return section;
}

std::vector<std::string> wf::config_backend_t::get_xml_dirs() const
Expand Down

0 comments on commit c38c595

Please sign in to comment.