Argument of Gtk.MenuShell.append() should be Gtk.Widget
To reproduce:
- Make a Vala file with GTK3 below:
Gtk.MenuItem item;
var sys_menu = new Gtk.Menu();
sys_menu.append(item);
- Convert the Vala file to C file with
valac --ccode
- Build the C file with GCC
The build warning happens:
panel.c:4872:57: warning: passing argument 2 of 'gtk_menu_shell_append' from incompatible pointer type [-Wincompatible-pointer-types]
4872 | gtk_menu_shell_append ((GtkMenuShell*) _tmp12_, _tmp13_);
/usr/include/gtk-3.0/gtk/gtkmenushell.h:92:55: note: expected 'GtkWidget *' {aka 'struct _GtkWidget *'} but argument is of type 'GtkMenuItem *' {aka 'struct _GtkMenuItem *'}
https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkmenushell.c#L507
In GTK3, the argument type of gtk_menu_shell_append() is specified to Gtk.MenuItem
as the GIR annotation in gtkmenushell.c and Vala requires Gtk.MenuItem
for the argument of Gtk.MenuShell.append().
Probably I think deleting the GIR annotation in gtkmenushell.c could fix the issue and hope to fix GTK3 branch.