X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=ioncore%2Fioncore_menudb.lua;h=0248b14751cc75f233907bb6730cba3c49bec9e3;hb=ae4260bb64817c11f9a7140324cd3e3ba113e297;hp=42860548298e9712d6f302b8560e3d6bab1c7052;hpb=de22e45179cb3bafa490294d31d47f361047a30a;p=ion3.git diff --git a/ioncore/ioncore_menudb.lua b/ioncore/ioncore_menudb.lua index 4286054..0248b14 100644 --- a/ioncore/ioncore_menudb.lua +++ b/ioncore/ioncore_menudb.lua @@ -3,10 +3,7 @@ -- -- Copyright (c) Tuomo Valkonen 2004-2007. -- --- Ion is free software; you can redistribute it and/or modify it under --- the terms of the GNU Lesser General Public License as published by --- the Free Software Foundation; either version 2.1 of the License, or --- (at your option) any later version. +-- See the included file LICENSE for details. -- local ioncore=_G.ioncore @@ -405,12 +402,16 @@ local function sortmenu(m) end -function menus.ctxmenu(reg, sub_or_chld) +function menus.ctxmenu(reg, sub) local m, r, s + if obj_is(sub, "WGroup") then + sub=(sub:bottom() or sub) + end + -- First, stuff between reg (inclusive) and sub_or_chld (inclusive) -- at the top level in the menu. - r=(sub_or_chld or reg) + r=(sub or reg) while r and s~=reg do local mm=get_ctxmenu(r, s) m=((m and table.icat(mm, m)) or mm)