Use imlib2 for taking screenshot; if it fails, use Xlib (issue #574)
This commit is contained in:
@@ -567,7 +567,10 @@ void get_snapshot(const char *path)
|
|||||||
|
|
||||||
XSync(server.display, False);
|
XSync(server.display, False);
|
||||||
|
|
||||||
Imlib_Image img = NULL;
|
imlib_context_set_drawable(panel->temp_pmap);
|
||||||
|
Imlib_Image img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 1);
|
||||||
|
|
||||||
|
if (!img) {
|
||||||
XImage *ximg =
|
XImage *ximg =
|
||||||
XGetImage(server.display, panel->temp_pmap, 0, 0, panel->area.width, panel->area.height, AllPlanes, ZPixmap);
|
XGetImage(server.display, panel->temp_pmap, 0, 0, panel->area.width, panel->area.height, AllPlanes, ZPixmap);
|
||||||
|
|
||||||
@@ -588,9 +591,7 @@ void get_snapshot(const char *path)
|
|||||||
}
|
}
|
||||||
XDestroyImage(ximg);
|
XDestroyImage(ximg);
|
||||||
img = imlib_create_image_using_data(panel->area.width, panel->area.height, pixels);
|
img = imlib_create_image_using_data(panel->area.width, panel->area.height, pixels);
|
||||||
} else {
|
}
|
||||||
imlib_context_set_drawable(panel->temp_pmap);
|
|
||||||
img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (img) {
|
if (img) {
|
||||||
|
|||||||
Reference in New Issue
Block a user