StatusIcon::StatusIcon() : icon_(gtk_status_icon_new()) {
gtk_status_icon_set_visible(icon_, TRUE);
+ g_signal_connect(icon_, "activate", G_CALLBACK(OnActivateThunk), this);
g_signal_connect(icon_, "popup-menu", G_CALLBACK(OnPopupMenuThunk), this);
}
menu_->PopupAsContextForStatusIcon(time, button, icon_);
}
+void StatusIcon::OnActivate(GtkWidget* widget) {
+ NotifyClicked();
+}
+
} // namespace atom
// Callback invoked when user right-clicks on the status icon.
CHROMEGTK_CALLBACK_2(StatusIcon, void, OnPopupMenu, guint, guint);
+ // Callback invoked when the icon is clicked.
+ CHROMEGTK_CALLBACK_0(StatusIcon, void, OnActivate);
+
// The currently-displayed icon for the window.
GtkStatusIcon* icon_;