fix(tray): sigsev on click when multiple icons is available

This commit is contained in:
Alexis
2018-11-16 12:01:03 +01:00
parent 33f138c16e
commit 69fceb1c92
3 changed files with 38 additions and 45 deletions

View File

@ -3,6 +3,7 @@
#include <dbus-status-notifier-item.h>
#include <gtkmm.h>
#include <json/json.h>
#include <libdbusmenu-gtk/dbusmenu-gtk.h>
#ifdef FILESYSTEM_EXPERIMENTAL
#include <experimental/filesystem>
#else
@ -17,12 +18,11 @@ public:
std::string bus_name;
std::string object_path;
Gtk::EventBox event_box;
Gtk::EventBox *event_box;
int icon_size;
int effective_icon_size;
Gtk::Image *image;
Gtk::Menu *gtk_menu = nullptr;
std::string category;
std::string id;
std::string status;
@ -35,7 +35,8 @@ public:
std::string attention_icon_name;
std::string attention_movie_name;
std::string icon_theme_path;
std::string menu;
DbusmenuGtkMenu *menu = nullptr;
Gtk::Menu *gtk_menu = nullptr;
bool item_is_menu;
private:
@ -45,7 +46,7 @@ private:
static void handleSecondaryActivate(GObject *, GAsyncResult *, gpointer);
void updateImage();
void updateMenu();
bool showMenu(GdkEventButton *const &ev);
Glib::RefPtr<Gdk::Pixbuf> extractPixBuf(GVariant *variant);
Glib::RefPtr<Gdk::Pixbuf> getIconByName(std::string name, int size);
bool handleClick(GdkEventButton *const & /*ev*/);