fix(hotcorners): keep one pending setCorner call per corner

main
reionwong 2 weeks ago
parent ab8c7ec5ff
commit fd1d86aac7

@ -87,12 +87,12 @@ void HotCorners::setCorner(const std::string& corner, const std::string& action,
{
if (!m_available)
return;
m_calls.push_back(m_corners.callAsync("setCorner", [this](const dbus::Reply& reply) {
m_calls[corner] = m_corners.callAsync("setCorner", [this](const dbus::Reply& reply) {
if (reply.isError()) {
fprintf(stderr, "Cannot update hot corner: %s\n", reply.error().message.c_str());
changed.emit();
}
}, corner, action, int32_t(modifiers)));
}, corner, action, int32_t(modifiers));
}
int HotCorners::heldModifiers() const

@ -3,6 +3,7 @@
#pragma once
#include <map>
#include <string>
#include "base/dbus.h"
@ -38,7 +39,8 @@ private:
cutefish::base::dbus::NameWatch m_watch;
cutefish::base::dbus::Match m_changedMatch;
cutefish::base::dbus::PendingCall m_reload;
std::vector<cutefish::base::dbus::PendingCall> m_calls;
// By corner: a newer change of a corner replaces its older one.
std::map<std::string, cutefish::base::dbus::PendingCall> m_calls;
cutefish::base::dbus::VariantMap m_properties;
bool m_available = false;
bool m_commandKeys = false;

Loading…
Cancel
Save