summaryrefslogtreecommitdiffstats
path: root/compton.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-01-09 20:25:01 +0800
committerRichard Grenville <[email protected]>2013-01-09 20:41:18 +0800
commit6e74af148e53a29734d0cfdcddc26211f5a5ff90 (patch)
tree2d4a123cc8226b6a30706cfd00f5ba2bec25a0f3 /compton.h
parent03ffecb4a0de95300fce6419abda3177db016f0b (diff)
downloadtdebase-6e74af148e53a29734d0cfdcddc26211f5a5ff90.tar.gz
tdebase-6e74af148e53a29734d0cfdcddc26211f5a5ff90.zip
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.
Diffstat (limited to 'compton.h')
-rw-r--r--compton.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/compton.h b/compton.h
index c7d65d30c..9bf25e240 100644
--- a/compton.h
+++ b/compton.h
@@ -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);
+ }
}
/**