Merge branch 'Alexays:master' into master
This commit is contained in:
@@ -242,7 +242,10 @@ void Workspaces::doUpdate() {
|
|||||||
auto wName = wNameRaw.starts_with("special:") ? wNameRaw.substr(8) : wNameRaw;
|
auto wName = wNameRaw.starts_with("special:") ? wNameRaw.substr(8) : wNameRaw;
|
||||||
return wName == workspace->name();
|
return wName == workspace->name();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (updated_workspace != updated_workspaces.end()) {
|
||||||
workspace->setOutput((*updated_workspace)["monitor"].asString());
|
workspace->setOutput((*updated_workspace)["monitor"].asString());
|
||||||
|
}
|
||||||
|
|
||||||
workspace->update(m_format, workspaceIcon, m_tooltipFormat);
|
workspace->update(m_format, workspaceIcon, m_tooltipFormat);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ PowerProfilesDaemon::PowerProfilesDaemon(const std::string& id, const Json::Valu
|
|||||||
// adresses for compatibility sake.
|
// adresses for compatibility sake.
|
||||||
//
|
//
|
||||||
// Revisit this in 2026, systems should be updated by then.
|
// Revisit this in 2026, systems should be updated by then.
|
||||||
|
|
||||||
Gio::DBus::Proxy::create_for_bus(Gio::DBus::BusType::BUS_TYPE_SYSTEM, "net.hadess.PowerProfiles",
|
Gio::DBus::Proxy::create_for_bus(Gio::DBus::BusType::BUS_TYPE_SYSTEM, "net.hadess.PowerProfiles",
|
||||||
"/net/hadess/PowerProfiles", "net.hadess.PowerProfiles",
|
"/net/hadess/PowerProfiles", "net.hadess.PowerProfiles",
|
||||||
sigc::mem_fun(*this, &PowerProfilesDaemon::busConnectedCb));
|
sigc::mem_fun(*this, &PowerProfilesDaemon::busConnectedCb));
|
||||||
@@ -175,10 +176,17 @@ auto PowerProfilesDaemon::update() -> void {
|
|||||||
|
|
||||||
bool PowerProfilesDaemon::handleToggle(GdkEventButton* const& e) {
|
bool PowerProfilesDaemon::handleToggle(GdkEventButton* const& e) {
|
||||||
if (e->type == GdkEventType::GDK_BUTTON_PRESS && connected_) {
|
if (e->type == GdkEventType::GDK_BUTTON_PRESS && connected_) {
|
||||||
|
if (e->button == 1) /* left click */ {
|
||||||
activeProfile_++;
|
activeProfile_++;
|
||||||
if (activeProfile_ == availableProfiles_.end()) {
|
if (activeProfile_ == availableProfiles_.end()) {
|
||||||
activeProfile_ = availableProfiles_.begin();
|
activeProfile_ = availableProfiles_.begin();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (activeProfile_ == availableProfiles_.begin()) {
|
||||||
|
activeProfile_ = availableProfiles_.end();
|
||||||
|
}
|
||||||
|
activeProfile_--;
|
||||||
|
}
|
||||||
|
|
||||||
using VarStr = Glib::Variant<Glib::ustring>;
|
using VarStr = Glib::Variant<Glib::ustring>;
|
||||||
using SetPowerProfileVar = Glib::Variant<std::tuple<Glib::ustring, Glib::ustring, VarStr>>;
|
using SetPowerProfileVar = Glib::Variant<std::tuple<Glib::ustring, Glib::ustring, VarStr>>;
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
|||||||
if (output.asString() == bar_.output->name) {
|
if (output.asString() == bar_.output->name) {
|
||||||
Json::Value v;
|
Json::Value v;
|
||||||
v["name"] = p_w_name;
|
v["name"] = p_w_name;
|
||||||
v["output"] = bar_.output->name;
|
v["target_output"] = bar_.output->name;
|
||||||
v["num"] = convertWorkspaceNameToNum(p_w_name);
|
v["num"] = convertWorkspaceNameToNum(p_w_name);
|
||||||
workspaces_.emplace_back(std::move(v));
|
workspaces_.emplace_back(std::move(v));
|
||||||
break;
|
break;
|
||||||
@@ -166,7 +166,7 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
|||||||
// Adding to all outputs
|
// Adding to all outputs
|
||||||
Json::Value v;
|
Json::Value v;
|
||||||
v["name"] = p_w_name;
|
v["name"] = p_w_name;
|
||||||
v["output"] = "";
|
v["target_output"] = "";
|
||||||
v["num"] = convertWorkspaceNameToNum(p_w_name);
|
v["num"] = convertWorkspaceNameToNum(p_w_name);
|
||||||
workspaces_.emplace_back(std::move(v));
|
workspaces_.emplace_back(std::move(v));
|
||||||
}
|
}
|
||||||
@@ -261,6 +261,10 @@ bool Workspaces::hasFlag(const Json::Value &node, const std::string &flag) {
|
|||||||
[&](auto const &e) { return hasFlag(e, flag); })) {
|
[&](auto const &e) { return hasFlag(e, flag); })) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (std::any_of(node["floating_nodes"].begin(), node["floating_nodes"].end(),
|
||||||
|
[&](auto const &e) { return hasFlag(e, flag); })) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,7 +317,7 @@ auto Workspaces::update() -> void {
|
|||||||
} else {
|
} else {
|
||||||
button.get_style_context()->remove_class("urgent");
|
button.get_style_context()->remove_class("urgent");
|
||||||
}
|
}
|
||||||
if (hasFlag((*it), "target_output")) {
|
if ((*it)["target_output"].isString()) {
|
||||||
button.get_style_context()->add_class("persistent");
|
button.get_style_context()->add_class("persistent");
|
||||||
} else {
|
} else {
|
||||||
button.get_style_context()->remove_class("persistent");
|
button.get_style_context()->remove_class("persistent");
|
||||||
|
|||||||
@@ -334,9 +334,7 @@ Task::Task(const waybar::Bar &bar, const Json::Value &config, Taskbar *tbar,
|
|||||||
}
|
}
|
||||||
|
|
||||||
button.add_events(Gdk::BUTTON_PRESS_MASK);
|
button.add_events(Gdk::BUTTON_PRESS_MASK);
|
||||||
button.signal_button_press_event().connect(sigc::mem_fun(*this, &Task::handle_clicked), false);
|
button.signal_button_release_event().connect(sigc::mem_fun(*this, &Task::handle_clicked), false);
|
||||||
button.signal_button_release_event().connect(sigc::mem_fun(*this, &Task::handle_button_release),
|
|
||||||
false);
|
|
||||||
|
|
||||||
button.signal_motion_notify_event().connect(sigc::mem_fun(*this, &Task::handle_motion_notify),
|
button.signal_motion_notify_event().connect(sigc::mem_fun(*this, &Task::handle_motion_notify),
|
||||||
false);
|
false);
|
||||||
@@ -573,12 +571,8 @@ bool Task::handle_clicked(GdkEventButton *bt) {
|
|||||||
else
|
else
|
||||||
spdlog::warn("Unknown action {}", action);
|
spdlog::warn("Unknown action {}", action);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Task::handle_button_release(GdkEventButton *bt) {
|
|
||||||
drag_start_button = -1;
|
drag_start_button = -1;
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Task::handle_motion_notify(GdkEventMotion *mn) {
|
bool Task::handle_motion_notify(GdkEventMotion *mn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user