This commit is contained in:
2025-11-26 22:31:09 +01:00
parent 5023b63a7e
commit 28f0fdb520
7 changed files with 111 additions and 20 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
}
int main(int argc, char **argv)
@@ -29,12 +36,11 @@ int main(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;