Correcting the issues on Linux target

This commit is contained in:
Dmitry Mikushin
2022-02-19 15:33:13 +01:00
parent c3c7cb273f
commit 7dd6cb99fa
2 changed files with 6 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
#include <gtk/gtk.h>
#include <libappindicator/app-indicator.h>
#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; }