Fix group signal-triggered group closing incorrectly
Some checks failed
clang-format / lint (push) Has been cancelled
freebsd / build (push) Has been cancelled
linux / build (c++20, alpine) (push) Has been cancelled
linux / build (c++20, archlinux) (push) Has been cancelled
linux / build (c++20, debian) (push) Has been cancelled
linux / build (c++20, fedora) (push) Has been cancelled
linux / build (c++20, gentoo) (push) Has been cancelled
linux / build (c++20, opensuse) (push) Has been cancelled
Nix-Tests / nix-flake-check (push) Has been cancelled

This commit is contained in:
2026-02-27 06:46:18 -08:00
parent 4d2fb11a05
commit 57a9bd83ff

View File

@ -67,7 +67,11 @@ Group::Group(const std::string& name, const std::string& id, const Json::Value&
const bool left_to_right = (drawer_config["transition-left-to-right"].isBool()
? drawer_config["transition-left-to-right"].asBool()
: true);
click_to_reveal = drawer_config["click-to-reveal"].asBool() || toggle_signal.has_value();
click_to_reveal = drawer_config["click-to-reveal"].asBool();
if (click_to_reveal && toggle_signal) {
throw std::runtime_error(
R"(A group cannot have both "click-to-reveal" and "toggle-signal".)");
}
auto transition_type = getPreferredTransitionType(vertical);
@ -108,14 +112,14 @@ void Group::hide_group() {
}
bool Group::handleMouseEnter(GdkEventCrossing* const& e) {
if (!click_to_reveal) {
if (!click_to_reveal && !toggle_signal) {
show_group();
}
return false;
}
bool Group::handleMouseLeave(GdkEventCrossing* const& e) {
if (!click_to_reveal && e->detail != GDK_NOTIFY_INFERIOR) {
if (!click_to_reveal && e->detail != GDK_NOTIFY_INFERIOR && !toggle_signal) {
hide_group();
}
return false;