From: Ben Hutchings Date: Sun, 2 Nov 2008 12:19:07 +0000 (+0000) Subject: [svn-upgrade] Integrating new upstream version, ion3 (20081002) X-Git-Tag: 20081002 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ion3.git;a=commitdiff_plain;h=29aae1975d46f66b97a2b873f1875eded8c6fbc3 [svn-upgrade] Integrating new upstream version, ion3 (20081002) --- diff --git a/ChangeLog b/ChangeLog index ca5dbae..1825d3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2008-10-02 15:29 UTC Tuomo Valkonen + tagged ion-3-20081002 + +2008-10-02 15:29 UTC Tuomo Valkonen + * Release notes + +2008-09-22 18:19 UTC Tuomo Valkonen + * SIZEPOLICY_VISIBILITY_CONSTRAINED + +2008-09-21 18:40 UTC Tuomo Valkonen + * WMPlex focus hack for the case of only an empty group to display. + +2008-09-15 21:10 UTC Tuomo Valkonen + * More select hack improvements + +2008-09-15 21:09 UTC Tuomo Valkonen + * Timer signal flag wasn't reset if there was no queue. + +2008-09-15 17:36 UTC Tuomo Valkonen + * Timer code had some strangeness + (that I didn't write). + +2008-09-15 17:34 UTC Tuomo Valkonen + * 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 + * Oops, missing free in ioncore.set + +2008-07-23 16:54 UTC Tuomo Valkonen + * More BadMatch ignore + +2008-07-23 17:30 UTC Tuomo Valkonen + * Do not log complaints about keysym to keycode conversion failure. + 2008-08-25 15:43 UTC Tuomo Valkonen tagged ion-3-20080825 diff --git a/RELNOTES b/RELNOTES index 80b1ad2..631e3c4 100644 --- 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 -------------- diff --git a/config.h b/config.h index 699d49f..bac7b43 100644 --- 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 */ diff --git a/exact-version b/exact-version index 7ea1116..dd17c91 100644 --- a/exact-version +++ b/exact-version @@ -1,5 +1,5 @@ Context: -[TAG ion-3-20080825 -Tuomo Valkonen **20080825154309] +[TAG ion-3-20081002 +Tuomo Valkonen **20081002152911] diff --git a/ioncore/conf-bindings.c b/ioncore/conf-bindings.c index d0d2fba..69d8996 100644 --- a/ioncore/conf-bindings.c +++ b/ioncore/conf-bindings.c @@ -20,6 +20,7 @@ #include #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; diff --git a/ioncore/conf.c b/ioncore/conf.c index 7142d32..258f563 100644 --- a/ioncore/conf.c +++ b/ioncore/conf.c @@ -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)) diff --git a/ioncore/group.c b/ioncore/group.c index ad38ee8..750c955 100644 --- a/ioncore/group.c +++ b/ioncore/group.c @@ -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'? */ diff --git a/ioncore/ioncore.c b/ioncore/ioncore.c index cef62df..33eb3e3 100644 --- a/ioncore/ioncore.c +++ b/ioncore/ioncore.c @@ -22,6 +22,7 @@ #ifndef CF_NO_GETTEXT #include #endif +#include #include #include @@ -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); } - /*}}}*/ diff --git a/ioncore/ioncore.h b/ioncore/ioncore.h index 7193c08..5756aab 100644 --- a/ioncore/ioncore.h +++ b/ioncore/ioncore.h @@ -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 */ diff --git a/ioncore/mplex.c b/ioncore/mplex.c index 4506ea7..7c511e7 100644 --- a/ioncore/mplex.c +++ b/ioncore/mplex.c @@ -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; diff --git a/ioncore/rootwin.c b/ioncore/rootwin.c index 1468302..fd2d258 100644 --- a/ioncore/rootwin.c +++ b/ioncore/rootwin.c @@ -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; diff --git a/ioncore/sizepolicy.c b/ioncore/sizepolicy.c index 87a3573..e1ee0c0 100644 --- a/ioncore/sizepolicy.c +++ b/ioncore/sizepolicy.c @@ -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 */ }; diff --git a/ioncore/sizepolicy.h b/ioncore/sizepolicy.h index 4e7ff54..49e89ea 100644 --- a/ioncore/sizepolicy.h +++ b/ioncore/sizepolicy.h @@ -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) diff --git a/libmainloop/select.c b/libmainloop/select.c index f8410a5..14070aa 100644 --- a/libmainloop/select.c +++ b/libmainloop/select.c @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -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) diff --git a/libmainloop/signal.c b/libmainloop/signal.c index fd37161..356fd6d 100644 --- a/libmainloop/signal.c +++ b/libmainloop/signal.c @@ -90,13 +90,13 @@ bool libmainloop_get_timeout(struct timeval *tv) mainloop_gettime(tv); if(TIMEVAL_LATER((queue)->when, (*tv))){ if(queue->when.tv_usectv_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(¤t_time); while(queue!=NULL){ if(TIMEVAL_LATER(current_time, queue->when)){ diff --git a/version.h b/version.h index 5533a74..7ed2db6 100644 --- 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"