From cb4b87ab1ab88e64bd48366dd3cf7c95c10df1fe Mon Sep 17 00:00:00 2001 From: Scott Moreau Date: Wed, 28 Aug 2024 20:30:03 -0600 Subject: [PATCH] core: Make exit binding configurable Fixes #2402. --- metadata/core.xml | 5 +++++ src/core/wm.cpp | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/metadata/core.xml b/metadata/core.xml index c75541374..211c9ec89 100644 --- a/metadata/core.xml +++ b/metadata/core.xml @@ -88,5 +88,10 @@ <_long>Whether to pass buttons through to the client when switching the focus via clicking true + diff --git a/src/core/wm.cpp b/src/core/wm.cpp index e48d6f2f8..15efa0b06 100644 --- a/src/core/wm.cpp +++ b/src/core/wm.cpp @@ -23,6 +23,8 @@ static void idle_shutdown(void *data) void wayfire_exit::init() { + wf::option_wrapper_t wayifre_exit_binding{"core/exit"}; + key = [] (const wf::keybinding_t&) { auto output_impl = static_cast(wf::get_core().seat->get_active_output()); @@ -35,8 +37,7 @@ void wayfire_exit::init() return true; }; - output->add_key(wf::create_option_string( - " KEY_BACKSPACE"), &key); + output->add_key(wayifre_exit_binding, &key); } void wayfire_exit::fini()