(sni) Be able to control order for system tray items.

This commit is contained in:
yangyingchao
2026-07-04 01:35:50 +02:00
committed by Alexays
parent 46e96dfbaa
commit c07f8ed0a4
7 changed files with 99 additions and 36 deletions
+9 -1
View File
@@ -24,11 +24,15 @@ struct ToolTip {
Glib::ustring text;
};
class Host;
using ItemOrderMap = std::unordered_map<std::string, int>;
class Item : public sigc::trackable {
public:
Item(const std::string&, const std::string&, const Json::Value&, const Bar&,
const std::function<void(Item&)>&, const std::function<void(Item&)>&,
const std::function<void()>&);
const std::function<void()>&, Host&, const ItemOrderMap&);
~Item();
bool isReady() const;
@@ -64,6 +68,7 @@ class Item : public sigc::trackable {
* while compliant SNI implementation would always reset the flag to desired value.
*/
bool item_is_menu = true;
int order_ = -1; // -1 means not set
private:
void onConfigure(GdkEventConfigure* ev);
@@ -114,6 +119,9 @@ class Item : public sigc::trackable {
Glib::RefPtr<Gio::DBus::Proxy> proxy_;
Glib::RefPtr<Gio::Cancellable> cancellable_;
std::set<std::string_view> update_pending_;
Host& host_;
const ItemOrderMap& orders_;
};
} // namespace waybar::modules::SNI