das-tools (Go, GTK 3 via gotk3): - das-update: update window, tray icon when updates are available, --cli mode; xbps-install -Su between a snapper pre/post snapshot pair, privileged part through pkexec, rollback and reboot hints - das-welcome: first-login window with install (live), language, home folder renaming, updates, settings and help das-settings 0.3.0: create home folders with translated names. xdg-user-dirs 0.20 only looks for translations in the first XDG_DATA_DIRS entry with a locale directory (/usr/local/share/locale). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
1007 B
C
31 lines
1007 B
C
// GtkStatusIcon is deprecated in GTK 3 but is the XEmbed tray icon that the
|
|
// Xfce panel's status tray shows, and gotk3 does not wrap it.
|
|
#define GDK_DISABLE_DEPRECATION_WARNINGS
|
|
#include <gtk/gtk.h>
|
|
#include "tray.h"
|
|
|
|
static void on_activate(GtkStatusIcon *icon, gpointer data) {
|
|
dasTrayActivate();
|
|
}
|
|
|
|
static void on_popup(GtkStatusIcon *icon, guint button, guint time, gpointer data) {
|
|
dasTrayPopup();
|
|
}
|
|
|
|
GtkStatusIcon *das_tray_new(const char *icon_name) {
|
|
GtkStatusIcon *icon = gtk_status_icon_new_from_icon_name(icon_name);
|
|
gtk_status_icon_set_visible(icon, FALSE);
|
|
g_signal_connect(icon, "activate", G_CALLBACK(on_activate), NULL);
|
|
g_signal_connect(icon, "popup-menu", G_CALLBACK(on_popup), NULL);
|
|
return icon;
|
|
}
|
|
|
|
void das_tray_set(GtkStatusIcon *icon, gboolean visible, const char *tooltip) {
|
|
gtk_status_icon_set_tooltip_text(icon, tooltip);
|
|
gtk_status_icon_set_visible(icon, visible);
|
|
}
|
|
|
|
void das_tray_popup(uintptr_t menu) {
|
|
gtk_menu_popup_at_pointer(GTK_MENU((gpointer)menu), NULL);
|
|
}
|