]> git.decadent.org.uk Git - ion3.git/commitdiff
[svn-upgrade] Integrating new upstream version, ion3 (20081002) 20081002
authorBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 12:19:07 +0000 (12:19 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 2 Nov 2008 12:21:45 +0000 (12:21 +0000)
16 files changed:
ChangeLog
RELNOTES
config.h
exact-version
ioncore/conf-bindings.c
ioncore/conf.c
ioncore/group.c
ioncore/ioncore.c
ioncore/ioncore.h
ioncore/mplex.c
ioncore/rootwin.c
ioncore/sizepolicy.c
ioncore/sizepolicy.h
libmainloop/select.c
libmainloop/signal.c
version.h

index ca5dbae34c751cbec397f11a586f2aad20546891..1825d3d4eb266b270b987a59737f0254648d6e8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2008-10-02 15:29 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  tagged ion-3-20081002
+
+2008-10-02 15:29 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Release notes
+
+2008-09-22 18:19 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * SIZEPOLICY_VISIBILITY_CONSTRAINED
+
+2008-09-21 18:40 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * WMPlex focus hack for the case of only an empty group to display.
+
+2008-09-15 21:10 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * More select hack improvements
+
+2008-09-15 21:09 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Timer signal flag wasn't reset if there was no queue.
+
+2008-09-15 17:36 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Timer code had some strangeness
+  (that I didn't write).
+
+2008-09-15 17:34 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Fixes to select hack when there's no pselect.
+  It was causing X synchronisation repetition that could cause 
+  e.g. completions to become unresponsive.
+
+2008-09-09 12:35 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Oops, missing free in ioncore.set
+
+2008-07-23 16:54 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * More BadMatch ignore
+
+2008-07-23 17:30 UTC  Tuomo Valkonen <tuomov@iki.fi>
+  * Do not log complaints about keysym to keycode conversion failure.
+
 2008-08-25 15:43 UTC  Tuomo Valkonen <tuomov@iki.fi>
   tagged ion-3-20080825
 
index 80b1ad2c885b15caa0468d0d205457e65ff6aa20..631e3c494f4ed95eff5d5ef87da26625909f3ff7 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -1,4 +1,11 @@
 
+ion-3-20081002
+--------------
+
+Some minor fixes again, including a few that should've already
+been in the previous release.
+
+
 ion-3-20080825
 --------------
 
index 699d49fa0874c415f83b79f44650ef55ac01eeff..bac7b4359c495313afd864639e4b124c98a479a3 100644 (file)
--- a/config.h
+++ b/config.h
@@ -28,6 +28,8 @@
 
 #define CF_STATUSBAR_SYSTRAY_HEIGHT 24
 
+#define CF_VISIBILITY_CONSTRAINT 16 /* = CF_EDGE_RESISTANCE */
+
 /* Cursors
  */
 
index 7ea1116025827786eec61c572bfd105f5fbdc7f4..dd17c91e0181e6d838b4c4aa8964119f4099e367 100644 (file)
@@ -1,5 +1,5 @@
 
 Context:
 
-[TAG ion-3-20080825
-Tuomo Valkonen <tuomov@iki.fi>**20080825154309
+[TAG ion-3-20081002
+Tuomo Valkonen <tuomov@iki.fi>**20081002152911
index d0d2fba8ea569afb21e65c671dba91a5619023c1..69d8996fac812e45cff7eb21fd86239dff611efd 100644 (file)
@@ -20,6 +20,7 @@
 #include <libextl/extl.h>
 #include "conf-bindings.h"
 #include "bindmaps.h"
+#include "ioncore.h"
 
 
 /*{{{ parse_keybut */
@@ -94,7 +95,8 @@ bool ioncore_parse_keybut(const char *str, uint *mod_ret, uint *ksb_ret,
                 break;
             }
             if(XKeysymToKeycode(ioncore_g.dpy, keysym)==0){
-                warn_obj(str, TR("Could not convert keysym to keycode."));
+                ioncore_warn_nolog("%s: %s", str, 
+                                   TR("Could not convert keysym to keycode."));
                 break;
             }
             *ksb_ret=keysym;
index 7142d3265da6b13ccf6dcb267d0317e6fed8ea88..258f563078132cc7f3d794dc3c2efd6bca3db7b9 100644 (file)
@@ -118,6 +118,7 @@ void ioncore_set(ExtlTab tab)
             ioncore_g.no_mousefocus=TRUE;
         else if(strcmp(tmp, "sloppy")==0)
             ioncore_g.no_mousefocus=FALSE;
+        free(tmp);
     }
     
     if(extl_table_gets_i(tab, "dblclick_delay", &dd))
index ad38ee8dd5a2a8129a7240236b4393519c015b84..750c95595e050a3e6a3b99f9ffbf28e680269269 100644 (file)
@@ -633,8 +633,8 @@ bool group_do_attach_final(WGroup *ws,
             ? param->szplcy
             : (param->bottom
                ? SIZEPOLICY_FULL_EXACT
-               : SIZEPOLICY_UNCONSTRAINED));
-        
+               : SIZEPOLICY_VISIBILITY_CONSTRAINED));
+    
     if(!param->whatever){
         weak=(param->geom_weak_set
               ? param->geom_weak
@@ -662,6 +662,7 @@ bool group_do_attach_final(WGroup *ws,
 
         if(weak&(REGION_RQGEOM_WEAK_X|REGION_RQGEOM_WEAK_Y) &&
             (szplcy==SIZEPOLICY_UNCONSTRAINED ||
+             szplcy==SIZEPOLICY_VISIBILITY_CONSTRAINED ||
              szplcy==SIZEPOLICY_FREE ||
              szplcy==SIZEPOLICY_FREE_GLUE /* without flags */)){
             /* TODO: use 'weak'? */
index cef62df1201338c91f17897c88903e1ea451cab6..33eb3e37d229e8856cc51b7989ffa1230abc950a 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef CF_NO_GETTEXT
 #include <libintl.h>
 #endif
+#include <stdarg.h>
 
 #include <libtu/util.h>
 #include <libtu/optparser.h>
@@ -99,12 +100,17 @@ WHook *ioncore_deinit_hook=NULL;
 /*{{{ warn_nolog */
 
 
-void ioncore_warn_nolog(const char *str)
+void ioncore_warn_nolog(const char *str, ...)
 {
-    fprintf(stderr, "%s: %s\n", libtu_progname(), str);
+    va_list args;
+    
+    va_start(args, str);
+    fprintf(stderr, "%s: ", libtu_progname());
+    vfprintf(stderr, str, args);
+    fprintf(stderr, "\n");
+    va_end(args);
 }
 
-
 /*}}}*/
 
 
index 7193c0899d700780f258198fad5925761c23c50b..5756aab44c5a277924708dec2cb6105bcd0b164a 100644 (file)
@@ -28,6 +28,6 @@ extern WHook *ioncore_post_layout_setup_hook;
 extern WHook *ioncore_snapshot_hook;
 extern WHook *ioncore_deinit_hook;
 
-extern void ioncore_warn_nolog(const char *str);
+extern void ioncore_warn_nolog(const char *str, ...);
 
 #endif /* ION_IONCORE_IONCORE_H */
index 4506ea744077de18167888058ad67883f4d19f38..7c511e75f3ec4ce7edcd88ffdaf04bd7dadf8d70 100644 (file)
@@ -667,6 +667,12 @@ static WStacking *mplex_do_to_focus_on(WMPlex *mplex, WStacking *node,
     
     st=mplex_find_to_focus(mplex, node, NULL, hidelist);
     
+    /* If 'node' points to a group, it isn't actually on the stacking list. 
+     * Give it the focus, if there's nothing "proper" that could be focussed.
+     */
+    if(st==NULL && grp!=NULL && REGION_IS_MAPPED(grp))
+        st=node;
+    
     if(st==node && within!=NULL)
         *within=TRUE;
         
index 1468302c56bf7aea60521c6ce6442ab25fe251d3..fd2d2584d054fc68aa0e4b88915599d4488372ed 100644 (file)
@@ -59,9 +59,13 @@ static int my_error_handler(Display *dpy, XErrorEvent *ev)
     
     /* Just ignore bad window and similar errors; makes the rest of
      * the code simpler.
+     * 
+     * Apparently XGetWindowProperty can return BadMatch on a race
+     * condition where the server is already reusing the XID for a 
+     * non-window drawable, so let's just ignore BadMatch entirely...
      */
     if((ev->error_code==BadWindow ||
-        (ev->error_code==BadMatch && ev->request_code==X_SetInputFocus) ||
+        (ev->error_code==BadMatch /*&& ev->request_code==X_SetInputFocus*/) ||
         (ev->error_code==BadDrawable && ev->request_code==X_GetGeometry)) &&
        ignore_badwindow)
         return 0;
index 87a3573e3a9ea741ce59286ff3b60daa8eb151b1..e1ee0c0fddb41d6f07ef4cb4175734f87faac2bb 100644 (file)
@@ -268,9 +268,24 @@ void sizepolicy(WSizePolicy *szplcy, WRegion *reg,
         break;
         
     case SIZEPOLICY_FREE:
+        if(reg!=NULL)
+            region_size_hints_correct(reg, &tmp.w, &tmp.h, FALSE);
         rectangle_constrain(&tmp, &(fp->g));
+        fp->g=tmp;
+        break;
+        
+    case SIZEPOLICY_VISIBILITY_CONSTRAINED:
         if(reg!=NULL)
             region_size_hints_correct(reg, &tmp.w, &tmp.h, FALSE);
+        { 
+            /* Constraint such that at least min(size, CF_VISIBILITY_CONSTRAINT) 
+             * much is visible at each border.
+             */
+            int dx=maxof(0, tmp.w-CF_VISIBILITY_CONSTRAINT);
+            int dy=maxof(0, tmp.h-CF_VISIBILITY_CONSTRAINT);
+            tmp.x=maxof(fp->g.x-dx, minof(tmp.x, fp->g.x+fp->g.w+dx-tmp.w));
+            tmp.y=maxof(fp->g.y-dy, minof(tmp.y, fp->g.y+fp->g.h+dy-tmp.h));
+        }
         fp->g=tmp;
         break;
         
@@ -321,6 +336,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},
+    {"visibility_constrained",   SIZEPOLICY_VISIBILITY_CONSTRAINED},
     {"unconstrained",   SIZEPOLICY_UNCONSTRAINED},
     { NULL,             SIZEPOLICY_DEFAULT}   /* end marker */
 };
index 4e7ff547e17766de4910cfc956d8fda4853c0e3d..49e89ea7756d439f25d603206d90f7f59b5ffa02 100644 (file)
@@ -40,6 +40,7 @@
 #define SIZEPOLICY_STRETCH_TOP    0x08
 #define SIZEPOLICY_STRETCH_BOTTOM 0x09
 #define SIZEPOLICY_UNCONSTRAINED  0x10
+#define SIZEPOLICY_VISIBILITY_CONSTRAINED  0x11
 
 #define SIZEPOLICY_GRAVITY_NORTHWEST (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_LEFT)
 #define SIZEPOLICY_GRAVITY_NORTH     (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_CENTER)
index f8410a5b846c46b318deb3d1a039576c0b0b6618..14070aabe6814a94a3e21838fcd8e34081c90155 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <signal.h>
 #include <sys/select.h>
+#include <errno.h>
 
 #include <libtu/types.h>
 #include <libtu/misc.h>
@@ -100,13 +101,13 @@ void mainloop_select()
     int nfds=0;
     int ret=0;
     
-    FD_ZERO(&rfds);
-    
-    set_input_fds(&rfds, &nfds);
     
 #ifdef _POSIX_SELECT
     {
         sigset_t oldmask;
+
+        FD_ZERO(&rfds);
+        set_input_fds(&rfds, &nfds);
         
         mainloop_block_signals(&oldmask);
         
@@ -118,18 +119,26 @@ void mainloop_select()
 #else
     #warning "pselect() unavailable -- using dirty hacks"
     {
-        struct timeval tv_={0, 0}, *tv=&tv_;
+        struct timeval tv={0, 0};
         
         /* If there are timers, make sure we return from select with 
          * some delay, if the timer signal happens right before
          * entering select(). Race conditions with other signals
          * we'll just have to ignore without pselect().
          */
-        if(!libmainloop_get_timeout(tv))
-            tv=NULL;
+        do{
+            FD_ZERO(&rfds);
+            set_input_fds(&rfds, &nfds);
             
-        if(!mainloop_unhandled_signals())
-            ret=select(nfds+1, &rfds, NULL, NULL, tv);
+            bool to=libmainloop_get_timeout(&tv);
+            
+            if(mainloop_unhandled_signals()){
+                ret=0;
+                break;
+            }
+            
+            ret=select(nfds+1, &rfds, NULL, NULL, to ? &tv : NULL);
+        }while(ret<0 && errno==EINTR && !mainloop_unhandled_signals());
     }
 #endif
     if(ret>0)
index fd37161b332689c7073b5065f930ab5e11549428..356fd6d71e495ffc6ea7844febc2d0ae7d9a3962 100644 (file)
@@ -90,13 +90,13 @@ bool libmainloop_get_timeout(struct timeval *tv)
     mainloop_gettime(tv);
     if(TIMEVAL_LATER((queue)->when, (*tv))){
         if(queue->when.tv_usec<tv->tv_usec){
-            queue->when.tv_usec+=USECS_IN_SEC;
-            queue->when.tv_sec--;
+            tv->tv_usec=(queue->when.tv_usec+USECS_IN_SEC)-tv->tv_usec;
+            /* TIMEVAL_LATER ensures >= 0 */
+            tv->tv_sec=(queue->when.tv_sec-1)-tv->tv_sec;
+        }else{
+            tv->tv_usec=queue->when.tv_usec-tv->tv_usec;
+            tv->tv_sec=queue->when.tv_sec-tv->tv_sec;
         }
-        tv->tv_usec=queue->when.tv_usec-tv->tv_usec;
-        tv->tv_sec=queue->when.tv_sec-tv->tv_sec;
-        if(tv->tv_usec<0)
-            tv->tv_usec=0;
         /* POSIX and some kernels have been designed by absolute morons and 
          * contain idiotic artificial restrictions on the value of tv_usec, 
          * that will only cause more code being run and clock cycles being 
@@ -226,8 +226,10 @@ bool mainloop_check_signals()
         return kill_sig;
 
     /* Check for timer events in the queue */
-    while(had_tmr && queue!=NULL){
+    while(had_tmr){
         had_tmr=FALSE;
+        if(queue==NULL)
+            break;
         mainloop_gettime(&current_time);
         while(queue!=NULL){
             if(TIMEVAL_LATER(current_time, queue->when)){
index 5533a749e4a4d9cdbff9051c02c9af125db951f5..7ed2db68f1a69d2314ba9c6b72e544807f21d740 100644 (file)
--- a/version.h
+++ b/version.h
@@ -1,3 +1,3 @@
-#define ION_RELEASE "3-20080825"
+#define ION_RELEASE "3-20081002"
 #define ION_VERSION ION_RELEASE
 #define ION_API_VERSION "3"