Bug fix #77 incorrect border_width handling & #73 window data issue

- (Hopefully) fix all incorrect handling of w->a.border_width in compton
  (#77). Thanks to baskerville for reporting.

- Attempt to fix #73 by correcting a mistake that window data is fetched
  from the wrong function. Thanks to zakkak.

- Add git commit/tag detection to Makefile for automatic versioning.

- Change -lGL linking order, to fix a segmentation fault caused by
  something in nvidia-drivers under FreeBSD, mentioned in #74. Thanks
  for the report from DachiChang.

- Link to -levent_core instead of -levent in Makefile. We might move to
  libev soon, though.

- Increase SWOPTI_TOLERANCE to handle the extraordinary delay of
  kqueue() under FreeBSD. Thanks for DachiChang's report.

- Add helper function dump_drawable() for debugging.

- Replace XInternAtom() calls with get_atom().

- Remove -lrt as it's unneeded.
This commit is contained in:
Richard Grenville
2013-01-09 20:25:01 +08:00
parent 3521f10a97
commit 7188054825
3 changed files with 87 additions and 68 deletions

View File

@ -128,7 +128,7 @@ typedef void(* event_callback_fn)(evutil_socket_t, short, void *);
#define REGISTER_PROP "_NET_WM_CM_S"
#define FADE_DELTA_TOLERANCE 0.2
#define SWOPTI_TOLERANCE 1000
#define SWOPTI_TOLERANCE 3000
#define WIN_GET_LEADER_MAX_RECURSION 20
#define SEC_WRAP (15L * 24L * 60L * 60L)
@ -879,10 +879,10 @@ static int
should_ignore(session_t *ps, unsigned long sequence);
/**
* Wrapper of XInternAtom() for convience.
* Wrapper of XInternAtom() for convenience.
*/
static inline Atom
get_atom(session_t *ps, char *atom_name) {
get_atom(session_t *ps, const char *atom_name) {
return XInternAtom(ps->dpy, atom_name, False);
}
@ -1530,8 +1530,25 @@ update_reg_ignore_expire(session_t *ps, const win *w) {
*/
static inline bool __attribute__((const))
win_has_frame(const win *w) {
return w->top_width || w->left_width || w->right_width
|| w->bottom_width;
return w->a.border_width
|| w->top_width || w->left_width || w->right_width || w->bottom_width;
}
/**
* Dump an drawable's info.
*/
static inline void
dump_drawable(session_t *ps, Drawable drawable) {
Window rroot = None;
int x = 0, y = 0;
unsigned width = 0, height = 0, border = 0, depth = 0;
if (XGetGeometry(ps->dpy, drawable, &rroot, &x, &y, &width, &height,
&border, &depth)) {
printf_dbgf("(%#010lx): x = %u, y = %u, wid = %u, hei = %d, b = %u, d = %u\n", drawable, x, y, width, height, border, depth);
}
else {
printf_dbgf("(%#010lx): Failed\n", drawable);
}
}
/**