diff --git a/CMakeLists.txt b/CMakeLists.txt index 734b570..db74afe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ else() ADD_DEFINITIONS(${APPINDICATOR_CFLAGS}) LINK_DIRECTORIES(${APPINDICATOR_LIBRARY_DIRS}) add_compile_definitions(TRAY_APPINDICATOR=1) - list(APPEND src ${CMAKE_CURRENT_SOURCE_DIR}/tray_windows.c) + list(APPEND src ${CMAKE_CURRENT_SOURCE_DIR}/tray_linux.c) endif() endif() endif() diff --git a/tray_linux.c b/tray_linux.c index b57fefd..0f3b59a 100644 --- a/tray_linux.c +++ b/tray_linux.c @@ -1,5 +1,6 @@ #include #include +#include "tray.h" #define TRAY_APPINDICATOR_ID "tray-id" @@ -40,7 +41,7 @@ static GtkMenuShell *_tray_menu(struct tray_menu *m) { return menu; } -static int tray_init(struct tray *tray) { +int tray_init(struct tray *tray) { if (gtk_init_check(0, NULL) == FALSE) { return -1; } @@ -51,17 +52,17 @@ static int tray_init(struct tray *tray) { return 0; } -static int tray_loop(int blocking) { +int tray_loop(int blocking) { gtk_main_iteration_do(blocking); return loop_result; } -static void tray_update(struct tray *tray) { +void tray_update(struct tray *tray) { app_indicator_set_icon(indicator, tray->icon); // GTK is all about reference counting, so previous menu should be destroyed // here app_indicator_set_menu(indicator, GTK_MENU(_tray_menu(tray->menu))); } -static void tray_exit() { loop_result = -1; } +void tray_exit() { loop_result = -1; }