Reload all devices after wake from suspend

This commit is contained in:
Erik Reider
2022-03-15 22:49:40 +01:00
parent 5396ffb71f
commit d47073ef13
3 changed files with 46 additions and 4 deletions

View File

@ -25,6 +25,10 @@ class UPower : public AModule {
static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data);
static void deviceRemoved_cb(UpClient *client, const gchar *object_path, gpointer data);
static void deviceNotify_cb(gpointer data);
static void prepareForSleep_cb(GDBusConnection *system_bus, const gchar *sender_name,
const gchar *object_path, const gchar *interface_name,
const gchar *signal_name, GVariant *parameters,
gpointer user_data);
void removeDevice(const std::string devicePath);
void addDevice(UpDevice *device);
void setDisplayDevice();
@ -41,6 +45,8 @@ class UPower : public AModule {
UpClient *client = NULL;
UpDevice *displayDevice = NULL;
std::map<std::string, UpDevice *> devices;
guint login1_id;
GDBusConnection *login1_connection;
};
} // namespace waybar::modules