better working tray
This commit is contained in:
@@ -50,7 +50,8 @@ class TrayService {
|
||||
bool separator = false;
|
||||
std::vector<MenuNode> children;
|
||||
};
|
||||
std::optional<MenuNode> get_menu_layout(const std::string &id);
|
||||
using MenuLayoutCallback = sigc::slot<void(std::optional<MenuNode>)>;
|
||||
void request_menu_layout(const std::string &id, MenuLayoutCallback callback);
|
||||
bool activate_menu_item(const std::string &id, int itemId);
|
||||
|
||||
sigc::signal<void(const Item &)> &signal_item_added();
|
||||
@@ -75,6 +76,11 @@ class TrayService {
|
||||
guint ownerWatchId = 0;
|
||||
Glib::RefPtr<Gio::MenuModel> menuModel;
|
||||
Glib::RefPtr<Gio::ActionGroup> menuActions;
|
||||
|
||||
guint refreshSourceId = 0;
|
||||
bool refreshInFlight = false;
|
||||
bool refreshQueued = false;
|
||||
bool addSignalPending = false;
|
||||
};
|
||||
|
||||
Glib::RefPtr<Gio::DBus::Connection> connection;
|
||||
@@ -124,7 +130,11 @@ class TrayService {
|
||||
void register_item(const Glib::ustring &sender, const std::string &service);
|
||||
void unregister_item(const std::string &id);
|
||||
|
||||
void refresh_item(TrackedItem &item);
|
||||
void schedule_refresh(const std::string &id);
|
||||
void begin_refresh(const std::string &id);
|
||||
static gboolean refresh_timeout_cb(gpointer user_data);
|
||||
static void on_refresh_finished_static(GObject *source, GAsyncResult *res,
|
||||
gpointer user_data);
|
||||
void emit_registered_items_changed();
|
||||
|
||||
Glib::Variant<std::vector<Glib::ustring>>
|
||||
|
||||
Reference in New Issue
Block a user