Skip to content

Commit

Permalink
[linux] fix gtk_menu_popup deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yapus committed Oct 25, 2019
1 parent 04779f7 commit 867c15a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions platform/linux/tray.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ void create_indicator(void *handle)

static void tray_icon_on_menu(GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data)
{
gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time());
// gtk_menu_popup_at_widget(GTK_MENU(menu), NULL, GDK_GRAVITY_SOUTH_EAST, NULL, gtk_get_current_event_time());
gtk_menu_popup_at_pointer(GTK_MENU(menu), NULL);
}

void create_status_icon()
Expand Down Expand Up @@ -146,6 +147,10 @@ void init(const char* title, struct image imageData)
}
}

void external_main_loop() {
gtk_widget_show_all(menu);
}

void native_loop()
{
external_main_loop();
Expand All @@ -157,9 +162,6 @@ void exit_loop()
gtk_main_quit();
}

void external_main_loop() {
gtk_widget_show_all(menu);
}


#endif // NATIVE_C
2 changes: 1 addition & 1 deletion trayhost.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
#cgo darwin LDFLAGS: -framework Cocoa
#cgo linux pkg-config: gtk+-3.0 appindicator3-0.1 libnotify
#cgo linux CFLAGS: -DLINUX
#cgo linux CFLAGS: -DLINUX -Wno-deprecated-declarations
#cgo linux LDFLAGS: -ldl
#cgo windows CFLAGS: -DWIN32
Expand Down

0 comments on commit 867c15a

Please sign in to comment.