kwo pushed a commit to branch master. http://git.enlightenment.org/legacy/imlib2.git/commit/?id=2d1ec6979bb8d4c772f95e9a5bd17f072761802e
commit 2d1ec6979bb8d4c772f95e9a5bd17f072761802e Author: Kim Woelders <[email protected]> Date: Sun Dec 17 11:04:18 2017 +0100 imlib2_grab: Always use imlib_create_scaled_image_from_drawable() to grab image Apparently, when using XShmGetImage to get an XImage for a (non-root?) window, the image no longer includes subwindows (like when using IncludeInferiors in GC). When using XGetImage the XImage still includes subwindows. imlib_create_scaled_image_from_drawable() (as opposed to imlib_create_image_from_drawable() ) is implemented in such a way that the drawable to be grabbed is always copied to a pixmap first. This way we always get the "IncludeInferiors" type grab we most likely want here. --- src/bin/imlib2_grab.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bin/imlib2_grab.c b/src/bin/imlib2_grab.c index 6333474..86e6173 100644 --- a/src/bin/imlib2_grab.c +++ b/src/bin/imlib2_grab.c @@ -135,11 +135,8 @@ main(int argc, char **argv) printf("Output : wxh=%ux%u\n", wo, ho); } - if ((wo != w) || (ho != h)) - im = imlib_create_scaled_image_from_drawable(None, 0, 0, w, h, wo, ho, 1, - (get_alpha) ? 1 : 0); - else - im = imlib_create_image_from_drawable((get_alpha) ? 1 : 0, 0, 0, w, h, 1); + im = imlib_create_scaled_image_from_drawable(None, 0, 0, w, h, wo, ho, 1, + (get_alpha) ? 1 : 0); if (!im) { fprintf(stderr, "Cannot grab image!\n"); --
