From 831140ef97f8ad74f97b65346da5c3b70924311b Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sat, 12 Apr 2008 13:02:18 +0000 Subject: [PATCH] [svn-upgrade] Integrating new upstream version, ion3 (20080411) --- ChangeLog | 41 +++++++++++++++++ RELNOTES | 7 +++ build/mkman.lua | 9 ++-- exact-version | 4 +- ioncore/attach.c | 19 +++----- ioncore/frame.c | 8 +++- ioncore/group-ws.c | 6 +-- ioncore/grouppholder.c | 10 +++-- ioncore/ioncore_menudb.lua | 2 +- ioncore/mplex.c | 86 +++++++++++++++++++----------------- ioncore/mplexpholder.c | 12 +++-- ioncore/sizepolicy.c | 1 + libextl/exact-version | 3 ++ libextl/libextl-mkexports.in | 10 ++--- mod_menu/menu.c | 2 +- mod_query/mod_query.lua | 4 +- version.h | 2 +- 17 files changed, 147 insertions(+), 79 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7551588..6bed12d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2008-04-11 15:02 UTC Tuomo Valkonen + tagged ion-3-20080411 + +2008-04-11 15:02 UTC Tuomo Valkonen + * Release notes + +2008-04-03 14:06 UTC Tuomo Valkonen + * Focus behaviour improvement + (in relation to scratchpad close w/ sticky windows). + +2008-04-02 09:45 UTC Tuomo Valkonen + * Workspace switch focus policy fix. + (Keep focus in a "sticky" window, if one has it.) + +2008-03-31 20:36 UTC Tuomo Valkonen + * Fixed frame load handler to support string-based mode + (as WFrame.set/get_mode do support). + +2008-03-31 20:03 UTC Tuomo Valkonen + * "unconstrained" size policy wasn't available to lua code + +2008-03-18 15:54 UTC Tuomo Valkonen + * string.gfind -> string.gmatch + +2008-02-24 19:46 UTC Tuomo Valkonen + * Attach wrapper fixes. + The changes related to session management code improvements had bypassed + the method for passing an existing object to load. + +2008-02-22 19:30 UTC Tuomo Valkonen + * Man page generation script fix + +2008-02-17 17:31 UTC Tuomo Valkonen + * unlinked placeholder unlink attempt segfault fix + +2008-02-17 15:02 UTC Tuomo Valkonen + * Fixed groupws dispose chain + +2008-02-06 06:52 UTC Tuomo Valkonen + * doc. fix + 2008-02-05 17:40 UTC Tuomo Valkonen tagged ion-3-20080207 diff --git a/RELNOTES b/RELNOTES index d5190c0..effb8a6 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,4 +1,11 @@ +ion-3-20080411 +-------------- + +This is a maintenance release that fixes a few issues in the +previous release. + + ion-3-20080207 -------------- diff --git a/build/mkman.lua b/build/mkman.lua index 95f0bd9..8c5d055 100644 --- a/build/mkman.lua +++ b/build/mkman.lua @@ -93,7 +93,7 @@ local function dobindings(fn, bindings) function p.submap(kcb_, list) if not list then return function(lst) - return submap(kcb_, lst) + return p.submap(kcb_, lst) end end return {action = "kpress", kcb = kcb_, submap = list} @@ -205,8 +205,11 @@ local function docgroup_bindings(bindings) local outi=0 local function parsetable(t, prefix) - for _, v in ipairs(t) do - if not v.invalid then + --for _, v in ipairs(t) do + -- ipairs doesn't like nil values, that e.g. submap_wait dummy might generate + for i=1,#t do + local v=t[i] + if v and not v.invalid then if v.kcb then v.kcb=string.gsub(v.kcb, "AnyModifier%+", "") end diff --git a/exact-version b/exact-version index 45a6e95..f38473e 100644 --- a/exact-version +++ b/exact-version @@ -1,5 +1,5 @@ Context: -[TAG ion-3-20080207 -Tuomo Valkonen **20080205174053] +[TAG ion-3-20080411 +Tuomo Valkonen **20080411150249] diff --git a/ioncore/attach.c b/ioncore/attach.c index 1c406b3..2ac8d18 100644 --- a/ioncore/attach.c +++ b/ioncore/attach.c @@ -133,11 +133,11 @@ WRegion *ioncore_newly_created=NULL; static WRegion *doit_load(WRegion *mgr, WWindow *par, const WFitParams *fp, WRegionDoAttachFn *cont, void *cont_param, - const WRegionAttachData *data) + ExtlTab tab, WPHolder **sm_ph) { WRegion *reg=NULL; - if(extl_table_gets_o(data->u.tab, "reg", (Obj**)®)){ + if(extl_table_gets_o(tab, "reg", (Obj**)®)){ if(!OBJ_IS(reg, WRegion)) return FALSE; }/*else if(extl_table_is_bool_set(tab, "reg_use_new")){ @@ -150,8 +150,8 @@ static WRegion *doit_load(WRegion *mgr, return doit_reparent(mgr, par, fp, cont, cont_param, reg); }else{ WLP p; - p.tab=data->u.tab; - p.sm_ph_p=NULL; + p.tab=tab; + p.sm_ph_p=sm_ph; return doit_new(mgr, par, fp, cont, cont_param, (WRegionCreateFn*)wrap_load, &p); @@ -164,13 +164,8 @@ WRegion *region_attach_load_helper(WRegion *mgr, WRegionDoAttachFn *fn, void *fn_param, ExtlTab tab, WPHolder **sm_ph) { - WLP p; - p.tab=tab; - p.sm_ph_p=sm_ph; - - return doit_new(mgr, par, fp, fn, fn_param, - (WRegionCreateFn*)wrap_load, &p); -} + return doit_load(mgr, par, fp, fn, fn_param, tab, sm_ph); +} WRegion *region_attach_helper(WRegion *mgr, @@ -182,7 +177,7 @@ WRegion *region_attach_helper(WRegion *mgr, return doit_new(mgr, par, fp, fn, fn_param, data->u.n.fn, data->u.n.param); }else if(data->type==REGION_ATTACH_LOAD){ - return doit_load(mgr, par, fp, fn, fn_param, data); + return doit_load(mgr, par, fp, fn, fn_param, data->u.tab, NULL); }else if(data->type==REGION_ATTACH_REPARENT){ return doit_reparent(mgr, par, fp, fn, fn_param, data->u.reg); }else{ diff --git a/ioncore/frame.c b/ioncore/frame.c index cc9903f..019cd8b 100644 --- a/ioncore/frame.c +++ b/ioncore/frame.c @@ -939,7 +939,13 @@ WRegion *frame_load(WWindow *par, const WFitParams *fp, ExtlTab tab) int mode=FRAME_MODE_UNKNOWN; WFrame *frame; - extl_table_gets_i(tab, "mode", &mode); + if(!extl_table_gets_i(tab, "mode", &mode)){ + char *tmp; + if(extl_table_gets_s(tab, "mode", &tmp)){ + mode=stringintmap_value(frame_modes, tmp, mode); + free(tmp); + } + } frame=create_frame(par, fp, mode); diff --git a/ioncore/group-ws.c b/ioncore/group-ws.c index d122a6d..4445c55 100644 --- a/ioncore/group-ws.c +++ b/ioncore/group-ws.c @@ -285,10 +285,8 @@ static bool group_empty_for_bottom_stdisp(WGroup *ws) static WRegion *groupws_managed_disposeroot(WGroupWS *ws, WRegion *reg) { if(group_bottom(&ws->grp)==reg){ - if(group_empty_for_bottom_stdisp(&ws->grp)){ - WRegion *tmpr=region_disposeroot((WRegion*)ws); - return (tmpr!=NULL ? tmpr : reg); - } + if(group_empty_for_bottom_stdisp(&ws->grp)) + return region_disposeroot((WRegion*)ws); } return reg; diff --git a/ioncore/grouppholder.c b/ioncore/grouppholder.c index 39ff6fc..cdd2dce 100644 --- a/ioncore/grouppholder.c +++ b/ioncore/grouppholder.c @@ -72,17 +72,21 @@ void grouppholder_do_unlink(WGroupPHolder *ph) if(group!=NULL){ UNLINK_ITEM(group->phs, ph, next, prev); - }else{ + }else if(ph->prev!=NULL){ WGroupPHolder *next=ph->next; - if(ph->prev!=NULL) - ph->prev->next=next; + ph->prev->next=next; if(next==NULL){ next=get_head(ph); assert(next->prev==ph); } next->prev=ph->prev; + }else{ + /* ph should not be on a list, if prev pointer is NULL (whereas + * next alone can be NULL in our semi-doubly-linked lists). + */ + assert(ph->next==NULL); } ph->group=NULL; diff --git a/ioncore/ioncore_menudb.lua b/ioncore/ioncore_menudb.lua index fdb0e42..17b0c4a 100644 --- a/ioncore/ioncore_menudb.lua +++ b/ioncore/ioncore_menudb.lua @@ -260,7 +260,7 @@ local function receive_styles(str) local styles={} local stylemenu={} - for look in string.gfind(data, "(look[-_][^\n]*)%.lua\n") do + for look in string.gmatch(data, "(look[-_][^\n]*)%.lua\n") do if not found[look] then found[look]=true table.insert(styles, look) diff --git a/ioncore/mplex.c b/ioncore/mplex.c index 53b6952..4506ea7 100644 --- a/ioncore/mplex.c +++ b/ioncore/mplex.c @@ -646,13 +646,6 @@ WStacking *mplex_find_to_focus(WMPlex *mplex, } -static WStacking *mplex_do_to_focus(WMPlex *mplex, WStacking *to_try, - PtrList **hidelist) -{ - return mplex_find_to_focus(mplex, to_try, NULL, hidelist); -} - - static WStacking *mplex_do_to_focus_on(WMPlex *mplex, WStacking *node, WStacking *to_try, PtrList **hidelist, bool *within) @@ -672,7 +665,7 @@ static WStacking *mplex_do_to_focus_on(WMPlex *mplex, WStacking *node, } } - st=mplex_do_to_focus(mplex, node, hidelist); + st=mplex_find_to_focus(mplex, node, NULL, hidelist); if(st==node && within!=NULL) *within=TRUE; @@ -699,37 +692,59 @@ static WStacking *has_stacking_within(WMPlex *mplex, WRegion *reg) } -static WStacking *mplex_to_focus(WMPlex *mplex) +/* 1. Try keep focus in REGION_ACTIVE_SUB. + * 2. Try given `node`. + * 3. Choose something else, attempting previous in focus history + * (unless `node` was set). + */ +static WStacking *mplex_to_focus(WMPlex *mplex, WStacking *node) { - WStacking *to_try=NULL; + WStacking *foc=NULL, *fallback=NULL; WRegion *reg=NULL; + bool within=FALSE; WStacking *st; - to_try=maybe_focusable(REGION_ACTIVE_SUB(mplex)); + foc=maybe_focusable(REGION_ACTIVE_SUB(mplex)); - if(to_try==NULL){ - /* Search focus history */ + if(foc==NULL && node==NULL){ + /* Search focus history if no specific attempt set.*/ for(reg=ioncore_g.focus_current; reg!=NULL; reg=reg->active_next){ - to_try=has_stacking_within(mplex, reg); - if(to_try!=NULL) + foc=has_stacking_within(mplex, reg); + if(foc!=NULL) break; } } - st=mplex_do_to_focus(mplex, to_try, NULL); + if(foc!=NULL){ + /*fallback=mplex_find_to_focus(mplex, foc, NULL, NULL);*/ + /* In the history search case, 'foc' might point to a group, + * since we don't properly try to find a stacking within it... + */ + fallback=mplex_do_to_focus_on(mplex, foc, NULL, NULL, NULL); + if(fallback!=foc) + foc=NULL; + } + + if(foc==NULL && node!=NULL) + foc=mplex_do_to_focus_on(mplex, node, NULL, NULL, &within); + + if(foc==NULL || !within) + foc=fallback; - return (st!=NULL - ? st - : (mplex->mx_current!=NULL - ? mplex->mx_current->st - : NULL)); + return foc; } void mplex_do_set_focus(WMPlex *mplex, bool warp) { if(!MPLEX_MGD_UNVIEWABLE(mplex)){ - WStacking *st=mplex_to_focus(mplex); + WStacking *st=mplex_to_focus(mplex, NULL); + + if(st==NULL){ + st=(mplex->mx_current!=NULL + ? mplex->mx_current->st + : NULL); + } if(st!=NULL){ region_do_set_focus(st->reg, warp); @@ -741,6 +756,15 @@ void mplex_do_set_focus(WMPlex *mplex, bool warp) } +static void mplex_refocus(WMPlex *mplex, WStacking *node, bool warp) +{ + WStacking *foc=mplex_to_focus(mplex, node); + + if(foc!=NULL) + region_maybewarp(foc->reg, warp); +} + + /*}}}*/ @@ -833,24 +857,6 @@ static void mplex_do_node_display(WMPlex *mplex, WStacking *node, } -static bool mplex_refocus(WMPlex *mplex, WStacking *node, bool warp) -{ - WStacking *foc=NULL; - bool within=FALSE; - - if(node!=NULL) - foc=mplex_do_to_focus_on(mplex, node, NULL, NULL, &within); - - if(foc==NULL || !within) - foc=mplex_to_focus(mplex); - - if(foc!=NULL) - region_maybewarp(foc->reg, warp); - - return within; -} - - bool mplex_do_prepare_focus(WMPlex *mplex, WStacking *node, WStacking *sub, int flags, WPrepareFocusResult *res) diff --git a/ioncore/mplexpholder.c b/ioncore/mplexpholder.c index 712cfba..7a75486 100644 --- a/ioncore/mplexpholder.c +++ b/ioncore/mplexpholder.c @@ -84,17 +84,21 @@ void mplexpholder_do_unlink(WMPlexPHolder *ph, WMPlex *mplex) UNLINK_ITEM(ph->after->phs, ph, next, prev); }else if(mplex!=NULL && on_ph_list(mplex->misc_phs, ph)){ UNLINK_ITEM(mplex->misc_phs, ph, next, prev); - }else{ + }else if(ph->prev!=NULL){ WMPlexPHolder *next=ph->next; - - if(ph->prev!=NULL) - ph->prev->next=next; + + ph->prev->next=next; if(next==NULL){ next=get_head(ph); assert(next->prev==ph); } next->prev=ph->prev; + }else{ + /* ph should not be on a list, if prev pointer is NULL (whereas + * next alone can be NULL in our semi-doubly-linked lists). + */ + assert(ph->next==NULL); } ph->after=NULL; diff --git a/ioncore/sizepolicy.c b/ioncore/sizepolicy.c index 8801df7..87a3573 100644 --- a/ioncore/sizepolicy.c +++ b/ioncore/sizepolicy.c @@ -321,6 +321,7 @@ static StringIntMap szplcy_specs[] = { {"free_glue_southwest", SIZEPOLICY_FREE_GLUE__SOUTHWEST}, {"free_glue_south", SIZEPOLICY_FREE_GLUE__SOUTH}, {"free_glue_southeast", SIZEPOLICY_FREE_GLUE__SOUTHEAST}, + {"unconstrained", SIZEPOLICY_UNCONSTRAINED}, { NULL, SIZEPOLICY_DEFAULT} /* end marker */ }; diff --git a/libextl/exact-version b/libextl/exact-version index 2ea85eb..6b7fcda 100644 --- a/libextl/exact-version +++ b/libextl/exact-version @@ -1,6 +1,9 @@ Context: +[lua 5.1 updates to mkexports +Tuomo Valkonen **20080318210900] + [Do not remove proxy from cache in object destroy watch handler. Tuomo Valkonen **20071215143858 The GC can remove it. Just have the pointer to the actual object be diff --git a/libextl/libextl-mkexports.in b/libextl/libextl-mkexports.in index a23ab1f..14674ba 100644 --- a/libextl/libextl-mkexports.in +++ b/libextl/libextl-mkexports.in @@ -18,16 +18,16 @@ -- Helper functions {{{ -function errorf(fmt, ...) - error(string.format(fmt, unpack(arg)), 2) +function errorf(...) + error(string.format(...), 2) end function matcherr(s) error(string.format("Parse error in \"%s...\"", string.sub(s, 1, 50)), 2) end -function fprintf(h, fmt, ...) - h:write(string.format(fmt, unpack(arg))) +function fprintf(h, ...) + h:write(string.format(...)) end function trim(str) @@ -208,7 +208,7 @@ function parse(d) end param=trim(param) if string.len(param)>0 then - for p in string.gfind(param .. ",", "([^,]*),") do + for p in string.gmatch(param .. ",", "([^,]*),") do local spec, objtype, varname=parse_type(p) idesc=idesc .. spec table.insert(itypes, objtype) diff --git a/mod_menu/menu.c b/mod_menu/menu.c index 3114a72..9a93bac 100644 --- a/mod_menu/menu.c +++ b/mod_menu/menu.c @@ -1036,7 +1036,7 @@ static void reset_scroll_timer() * * \begin{tabularx}{\linewidth}{lX} * \tabhead{Field & Description} - * \var{scroll_amount} & Number of pixels to scroll at a time + * \var{scroll_amount} & Number of pixels to scroll at a time in * pointer-controlled menus when one extends * beyond a border of the screen and the pointer * touches that border. \\ diff --git a/mod_query/mod_query.lua b/mod_query/mod_query.lua index d3ef7a0..3685ade 100644 --- a/mod_query/mod_query.lua +++ b/mod_query/mod_query.lua @@ -910,7 +910,7 @@ function mod_query.get_hostnicks(mplex) patterns=pat elseif string.find(substr, "^[nN][aA][mM][eE]") and patterns then - for s in string.gfind(patterns, "%S+") do + for s in string.gmatch(patterns, "%S+") do if not string.find(s, "[*?]") then table.insert(mod_query.hostnicks, s) end @@ -1068,7 +1068,7 @@ function mod_query.do_complete_lua(env, str) -- Descend into tables if tocomp and string.len(tocomp)>=1 then - for t in string.gfind(tocomp, "([^.:]*)[.:]") do + for t in string.gmatch(tocomp, "([^.:]*)[.:]") do metas=false if string.len(t)==0 then comptab=env; diff --git a/version.h b/version.h index d3cf125..9aba166 100644 --- a/version.h +++ b/version.h @@ -1,3 +1,3 @@ -#define ION_RELEASE "3-20080207" +#define ION_RELEASE "3-20080411" #define ION_VERSION ION_RELEASE #define ION_API_VERSION "3" -- 2.39.5