]> git.decadent.org.uk Git - ion3.git/commitdiff
[svn-upgrade] Integrating new upstream version, ion3 (20080411) 20080411
authorBen Hutchings <ben@decadent.org.uk>
Sat, 12 Apr 2008 13:02:18 +0000 (13:02 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 12:21:31 +0000 (12:21 +0000)
17 files changed:
ChangeLog
RELNOTES
build/mkman.lua
exact-version
ioncore/attach.c
ioncore/frame.c
ioncore/group-ws.c
ioncore/grouppholder.c
ioncore/ioncore_menudb.lua
ioncore/mplex.c
ioncore/mplexpholder.c
ioncore/sizepolicy.c
libextl/exact-version
libextl/libextl-mkexports.in
mod_menu/menu.c
mod_query/mod_query.lua
version.h

index 7551588b388fd232485ce46afd2ea0448ea150bb..6bed12d7faaa9c7a948a7789d586125dffa0b5e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2008-04-11 15:02 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  tagged ion-3-20080411
+
+2008-04-11 15:02 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Release notes
+
+2008-04-03 14:06 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Focus behaviour improvement
+  (in relation to scratchpad close w/ sticky windows).
+
+2008-04-02 09:45 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Workspace switch focus policy fix.
+  (Keep focus in a "sticky" window, if one has it.)
+
+2008-03-31 20:36 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Fixed frame load handler to support string-based mode
+  (as WFrame.set/get_mode do support).
+
+2008-03-31 20:03 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * "unconstrained" size policy wasn't available to lua code
+
+2008-03-18 15:54 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * string.gfind -> string.gmatch
+
+2008-02-24 19:46 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * 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 <tuomov@iki.fi>
+  * Man page generation script fix
+
+2008-02-17 17:31 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * unlinked placeholder unlink attempt segfault fix
+
+2008-02-17 15:02 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Fixed groupws dispose chain
+
+2008-02-06 06:52 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * doc. fix
+
 2008-02-05 17:40 UTC  Tuomo Valkonen <tuomov@iki.fi>
   tagged ion-3-20080207
 
index d5190c04a5320e52598acdf83b76cbe072458887..effb8a60e0aa7fbd4b4460a6243ef0e68a237aa1 100644 (file)
--- 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
 --------------
 
index 95f0bd92e361ea5adcdc75bcad775d1de60c0d66..8c5d0552d352914ea62c9522e039406c2418692f 100644 (file)
@@ -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
index 45a6e95fc260404342469af9ba1853337136d4f5..f38473ebf369e8134f7a9306463339409b4438ff 100644 (file)
@@ -1,5 +1,5 @@
 
 Context:
 
-[TAG ion-3-20080207
-Tuomo Valkonen <tuomov@iki.fi>**20080205174053
+[TAG ion-3-20080411
+Tuomo Valkonen <tuomov@iki.fi>**20080411150249
index 1c406b3f5be444a493baa3528739b08784444411..2ac8d18ce3c08e2ce5886396370dbf86dbf2b731 100644 (file)
@@ -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**)&reg)){
+    if(extl_table_gets_o(tab, "reg", (Obj**)&reg)){
         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{
index cc9903fcc5af7b055a1bb6722be99d79b1f183ed..019cd8b4ee8d6490f33b55fa86495d3c0d4e3a7c 100644 (file)
@@ -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);
     
index d122a6df411c53dc53c0d74be2a50ab50306bc63..4445c55c575a34df3427a09d1a9336b22631e577 100644 (file)
@@ -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;
index 39ff6fc519b34372d61f1a98c52842607a826818..cdd2dce546b35b144132d83adc1340f63750e7ba 100644 (file)
@@ -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;
index fdb0e422bf8bfddc90e7b381461a3fe51385a250..17b0c4af51e0b9274cef431eb05f273cbf04e78a 100644 (file)
@@ -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)
index 53b69524b03585d6b1df3d3865fa82ffd85ae2d3..4506ea744077de18167888058ad67883f4d19f38 100644 (file)
@@ -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)
index 712cfba7304fc0e6cd5a28bd5b7f8d858841e566..7a75486ef495ecc618857666f8cba84cacfd00e0 100644 (file)
@@ -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;
index 8801df7efc150bbf8b56fae87af1127710ae2bd3..87a3573e3a9ea741ce59286ff3b60daa8eb151b1 100644 (file)
@@ -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 */
 };
 
index 2ea85eb38e57e4cc43ffaa8dec79bef4e1faf7be..6b7fcda5905c7253ccc08b7c88607b32cd78f87f 100644 (file)
@@ -1,6 +1,9 @@
 
 Context:
 
+[lua 5.1 updates to mkexports
+Tuomo Valkonen <tuomov@iki.fi>**20080318210900] 
+
 [Do not remove proxy from cache in object destroy watch handler.
 Tuomo Valkonen <tuomov@iki.fi>**20071215143858
  The GC can remove it. Just have the pointer to the actual object be 
index a23ab1fbc3d14cba6f35ba7e8d14a09b0b0ed538..14674ba892bf6edbadcb6eca4cb503858ca106a2 100644 (file)
 
 -- 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)
index 3114a723a8139d45d6fdb7acf300fad043cd32e0..9a93baca45b73e5a5eacbc140449f9e46ac0b857 100644 (file)
@@ -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. \\
index d3ef7a06b031952a40a250cfb9a1286976526d30..3685adedf95c5fc86c7ad6a7f95f171014669e3d 100644 (file)
@@ -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;
index d3cf12573cef487fb56a909a1b5b7d1f2a799ca3..9aba166793052b56574251d45ab895c4dec3fa3a 100644 (file)
--- 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"