summaryrefslogtreecommitdiff
path: root/src/ui/menu.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-03-02 18:20:30 +0100
committerZenWalker <[email protected]>2019-03-28 14:21:01 +0100
commitb0df98a1c2745b20325ae1d70413601dda9b46dd (patch)
tree5548e03f391640d87eba01ff61e73e4554497a05 /src/ui/menu.c
parent83a915dc851f7d3385e0d38f57cc249e038dcd1d (diff)
downloadmarco-b0df98a1c2745b20325ae1d70413601dda9b46dd.tar.bz2
marco-b0df98a1c2745b20325ae1d70413601dda9b46dd.tar.xz
Fix -Werror=cast-function-type
Bump glib-2 required version to 2.58: G_SOURCE_FUNC https://gitlab.gnome.org/GNOME/glib/commit/039fa6897bb4c5cd30caec8ee3add1a4ef612f76 Build & install:i export CC=gcci export CFLAGS=-Werror=cast-function-type ./autogen.sh --prefix=/usr make clean make sudo make install
Diffstat (limited to 'src/ui/menu.c')
-rw-r--r--src/ui/menu.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/ui/menu.c b/src/ui/menu.c
index aeba64fa..90db5f1e 100644
--- a/src/ui/menu.c
+++ b/src/ui/menu.c
@@ -100,6 +100,21 @@ static MenuItem menuitems[] = {
{META_MENU_OP_DELETE, MENU_ITEM_IMAGE, MARCO_STOCK_DELETE, FALSE, N_("_Close")}
};
+static void
+sn_menu_data_free (MenuData *menu_data,
+ GClosure *closure)
+{
+ g_free (menu_data->menu);
+ g_free (menu_data);
+}
+
+static void
+sn_menu_item_free (MenuItem *menu_item,
+ GClosure *closure)
+{
+ g_free (menu_item);
+}
+
static void popup_position_func(GtkMenu* menu, gint* x, gint* y, gboolean* push_in, gpointer user_data)
{
GtkRequisition req;
@@ -442,7 +457,7 @@ meta_window_menu_new (MetaFrames *frames,
"activate",
G_CALLBACK (activate_cb),
md,
- (GClosureNotify) g_free, 0);
+ (GClosureNotify) sn_menu_data_free, 0);
gtk_menu_shell_append (GTK_MENU_SHELL (submenu), submi);
@@ -469,7 +484,7 @@ meta_window_menu_new (MetaFrames *frames,
"activate",
G_CALLBACK (activate_cb),
md,
- (GClosureNotify) g_free, 0);
+ (GClosureNotify) sn_menu_item_free, 0);
}
if (mi)