+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
+ion-3-20081002
+--------------
+
+Some minor fixes again, including a few that should've already
+been in the previous release.
+
+
ion-3-20080825
--------------
#define CF_STATUSBAR_SYSTRAY_HEIGHT 24
+#define CF_VISIBILITY_CONSTRAINT 16 /* = CF_EDGE_RESISTANCE */
+
/* Cursors
*/
Context:
-[TAG ion-3-20080825
-Tuomo Valkonen <tuomov@iki.fi>**20080825154309]
+[TAG ion-3-20081002
+Tuomo Valkonen <tuomov@iki.fi>**20081002152911]
#include <libextl/extl.h>
#include "conf-bindings.h"
#include "bindmaps.h"
+#include "ioncore.h"
/*{{{ parse_keybut */
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;
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))
? param->szplcy
: (param->bottom
? SIZEPOLICY_FULL_EXACT
- : SIZEPOLICY_UNCONSTRAINED));
-
+ : SIZEPOLICY_VISIBILITY_CONSTRAINED));
+
if(!param->whatever){
weak=(param->geom_weak_set
? param->geom_weak
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'? */
#ifndef CF_NO_GETTEXT
#include <libintl.h>
#endif
+#include <stdarg.h>
#include <libtu/util.h>
#include <libtu/optparser.h>
/*{{{ 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);
}
-
/*}}}*/
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 */
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;
/* 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;
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;
{"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 */
};
#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)
#include <signal.h>
#include <sys/select.h>
+#include <errno.h>
#include <libtu/types.h>
#include <libtu/misc.h>
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);
#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)
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
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)){
-#define ION_RELEASE "3-20080825"
+#define ION_RELEASE "3-20081002"
#define ION_VERSION ION_RELEASE
#define ION_API_VERSION "3"