summaryrefslogtreecommitdiffstats
path: root/compton.c
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2014-09-07 18:58:09 +0800
committerRichard Grenville <pyxlcy@gmail.com>2014-09-07 18:58:09 +0800
commite3717f4f7bf3a0a0a015337454f1e381a6e0278f (patch)
tree154628c6c6fc92922281573b424f076b1ff784f5 /compton.c
parent886cdca8a59d0ce17d380560490ea06b9f089aa3 (diff)
downloadtdebase-e3717f4f7bf3a0a0a015337454f1e381a6e0278f.tar.gz
tdebase-e3717f4f7bf3a0a0a015337454f1e381a6e0278f.zip
Misc #204: Add glx_take_screenshot() & others
- Add glx_take_screenshot() for taking a screenshot. With ImageMagick the output data could be viewed in this way: display -size [SCREEN-WIDTH]x[SCREEN-HEIGHT] -depth 8 -flip rgb:[PATH] (#204) - Add D-Bus command `opts_get string:paint_on_overlay_id` to get X Composite overlay window ID. (#204) - Code cleanup.
Diffstat (limited to 'compton.c')
-rw-r--r--compton.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/compton.c b/compton.c
index 330155891..b967372ee 100644
--- a/compton.c
+++ b/compton.c
@@ -1411,6 +1411,20 @@ xr_blur_dst(session_t *ps, Picture tgt_buffer,
return true;
}
+/*
+ * WORK-IN-PROGRESS!
+static void
+xr_take_screenshot(session_t *ps) {
+ XImage *img = XGetImage(ps->dpy, get_tgt_window(ps), 0, 0,
+ ps->root_width, ps->root_height, AllPlanes, XYPixmap);
+ if (!img) {
+ printf_errf("(): Failed to get XImage.");
+ return NULL;
+ }
+ assert(0 == img->xoffset);
+}
+*/
+
/**
* Blur the background of a window.
*/
@@ -7530,6 +7544,16 @@ session_destroy(session_t *ps) {
ps_g = NULL;
}
+/*
+static inline void
+dump_img(session_t *ps) {
+ int len = 0;
+ unsigned char *d = glx_take_screenshot(ps, &len);
+ write_binary_data("/tmp/dump.raw", d, len);
+ free(d);
+}
+*/
+
/**
* Do the actual work.
*