# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1614120199 0 # Node ID 258c1b9c29f41cdbca527aeb3dd86bc7072bb1b3 # Parent 55524dbe6a54c0720721e9b95145b2c7b25fcacd GTK4: Implement DW_MENU_AUTO and DW_MENU_POPUP. These weren't necessary on GTK3 and earlier, so the options were just ignored. In GTK4 they are required for creating the GActions so it functions more like OS/2 and Windows now. diff -r 55524dbe6a54 -r 258c1b9c29f4 gtk4/dw.c --- a/gtk4/dw.c Tue Feb 23 21:35:06 2021 +0000 +++ b/gtk4/dw.c Tue Feb 23 22:43:19 2021 +0000 @@ -2839,6 +2839,30 @@ int menugroup = DW_POINTER_TO_INT(g_object_get_data(G_OBJECT(menu), "_dw_menugroup")); char *actionname; + /* Code to autogenerate a menu ID if not specified or invalid + * First pool is smaller for transient popup menus + */ + if(id == (ULONG)-1) + { + static ULONG tempid = 60000; + + tempid++; + id = tempid; + + if(tempid > 65500) + tempid = 60000; + } + /* Second pool is larger for more static windows */ + else if(!id || id >= 30000) + { + static ULONG menuid = 30000; + + menuid++; + if(menuid > 60000) + menuid = 30000; + id = menuid; + } + snprintf(tempbuf, 100, "menu%d.action%lu", menugroup, id); actionname = strchr(tempbuf, '.'); if(check)