This commit is contained in:
2025-11-27 09:46:00 +01:00
7 changed files with 107 additions and 23 deletions

View File

@@ -8,8 +8,11 @@ extern "C" {
#include "yellownotes.h"
#include "info_over_me.h"
SIGNAL(YellowNotes, on_tray_activate, popupTrayMenu)
#ifndef TARGET_OS_OSX
SIGNAL(YellowNotes, on_tray_activate, popupTrayMenu);
#else
BSIGNAL2(YellowNotes, on_tray_btn, popupTrayMenuBtn, GdkEventButton);
#endif
static void activate (GtkApplication* app, gpointer user_data)
{
GtkWidget *window;
@@ -17,7 +20,11 @@ static void activate (GtkApplication* app, gpointer user_data)
std::string img_file = notes->imageFile("yellownotes");
GtkStatusIcon *tray = gtk_status_icon_new_from_file(img_file.c_str());
#ifdef TARGET_OS_OSX
g_signal_connect(tray, "button_press_event", on_tray_btn, notes);
#else
g_signal_connect(tray, "activate", on_tray_activate, notes);
#endif
}
static int runMain(int argc, char **argv);
@@ -42,12 +49,11 @@ int runMain(int argc, char **argv)
srand(time(NULL)); // seed with current time
std::string my_path = w.containingFolder();
try {
l.loadGtk();
} catch(std::string msg) {
std::cerr << msg << std::endl;
exit(2);
}
GtkApplication *app;