Creating a click through window
Loki <[email protected]> Sun, 28 Jun 2026 09:40:49 +0100
| Newsgroups | gmane.comp.freedesktop.xcb |
|---|---|
| Message-ID | <CAOhw4OgrzQBBByu1kGk7hqnZTRH9hAott1i=i0ShkZ8YXkp-kg@mail.gmail.com> |
--0000000000002089f006554c4da1
Content-Type: text/plain; charset="UTF-8"
Hi (again),
(I accidentally forgot to subscribe to the mailing list... apologies this
is my first time using one)
I've created an issue on the good ol' stack-overflow (
https://stackoverflow.com/q/79968617/31156477) but haven't received an
answer that works yet...
I was hoping someone could help me figure out how i can click inside of a
window and have my mouse interact with what's behind that window.
I'm doing so because when i use xcb_copy_area it begins flickering when
using large scales and any windows i drag, draw over what's being drawn to
the top of my screen, by xcb_copy_area. I'm essentially trying to create a
nice little overlay which i can animate to.
Here's my code (and compile args are just below) so far;
// compile args; gcc -o pixel_xcb pixel_xcb.c -lxcb -lxcb-image -lxcb-shape
-lxcb-xfixes
// code adapted from here
https://xorg.freedesktop.org/archive/X11R7.7/doc/libxcb/tutorial/index.html#intro
// extra info here https://xcb.freedesktop.org/manual/group__XCB____API.html
// comparisons here
https://www.x.org/guide/xlib-and-xcb/#example:convertingxdpyinfoextensionqueriestoxcb
// so can i use this to save an image and then draw it to the screen?
//
https://stackoverflow.com/questions/34176795/any-efficient-way-of-converting-ximage-data-to-pixel-map-e-g-array-of-rgb-quad
// maybe something useful for shm here
http://metan.ucw.cz/blog/things-i-wanted-to-know-about-libxcb.html
#include <xcb/xcb.h>
#include <xcb/xcb_image.h>
#include <xcb/xproto.h>
#include <stdio.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <xcb/shape.h>
#include <xcb/xfixes.h>
//#include "/home/loki/Documents/libxcb-errors-master/src/xcb_errors.c"
// click through xcb
https://shallowsky.com/blog/programming/translucent-window-click-thru.html
xcb_screen_t *screen_of_display (xcb_connection_t *c, int screen){
xcb_screen_iterator_t iter;
iter = xcb_setup_roots_iterator (xcb_get_setup (c));
for (; iter.rem; --screen, xcb_screen_next (&iter))
if (screen == 0)
return iter.data;
return NULL;
}
int main(){
// display and screen
int screen_default_nbr;
xcb_connection_t *c = xcb_connect (NULL, &screen_default_nbr);
// screen
xcb_screen_t* screen = screen_of_display (c, screen_default_nbr);
// root display (screen / root window with other screens as background)
xcb_window_t root_window = { 0 };
root_window = screen->root;
// gc (black)
uint32_t values[4];
uint32_t mask = 0;
xcb_gcontext_t gc;
gc = xcb_generate_id (c);
mask = XCB_GC_FUNCTION | XCB_GC_FOREGROUND | XCB_GC_BACKGROUND |
XCB_GC_SUBWINDOW_MODE;
values[0] = XCB_GX_COPY;
values[1] = screen->black_pixel;
values[2] = screen->white_pixel;
values[3] = XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS;
xcb_create_gc (c, gc, root_window, mask, values);
// window
xcb_window_t window = xcb_generate_id (c);
xcb_create_window (c, /* Connection */
XCB_COPY_FROM_PARENT, /* depth (same as
root)*/
window, /* window Id
*/
screen->root, /* parent window
*/
0, 0, /* x, y
*/
150, 150, /* width, height
*/
10, /* border_width
*/
XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class
*/
screen->root_visual, /* visual
*/
0, NULL ); /* masks, not
used yet */
const uint32_t valuess[] ={1};
//xcb_change_window_attributes (c, window,
XCB_CW_OVERRIDE_REDIRECT, valuess);
uint32_t client_major_version = XCB_XFIXES_MAJOR_VERSION;
uint32_t client_minor_version = XCB_XFIXES_MINOR_VERSION;
xcb_xfixes_query_version_cookie_t cook =
xcb_xfixes_query_version(c, client_major_version, client_minor_version);
//xcb_generic_error_t *err;
//printf("%d", err->major_code);
xcb_xfixes_query_version_reply_t* rep =
xcb_xfixes_query_version_reply(c, cook, NULL);
xcb_rectangle_t rect [1] = {{0, 0, 110, 110}};
xcb_xfixes_region_t region = xcb_generate_id(c);
xcb_xfixes_create_region(c, region, 1, rect);
xcb_xfixes_set_window_shape_region(c, window, 2, 0, 0, region);
/* Map the window on the screen */
xcb_map_window (c, window);
//
https://stackoverflow.com/questions/16400937/click-through-transparent-xlib-windows
/*
XRectangle rect;
XserverRegion region = XFixesCreateRegion(display, &rect, 1);
XFixesSetWindowShapeRegion(display, window, ShapeInput, 0, 0, region);
XFixesDestroyRegion(display, region);*/
// pixmap
/*xcb_pixmap_t pix = xcb_generate_id (c);
xcb_create_pixmap (c, screen->root_depth,
pix, /* Id of the pixmap *
screen->root,
screen->width_in_pixels, /* Width
of the window (in pixels) *
screen->height_in_pixels);
uint32_t vals [1];
vals[0] = 0xffffff80;
// image
xcb_get_image_reply_t* img = xcb_get_image_reply(
c,
xcb_get_image (
c,
XCB_IMAGE_FORMAT_Z_PIXMAP,
root_window,
0,
0,
100,
100,
0
),
NULL
);
//for (int x = 0; x < ){
xcb_point_t points [1];
points[0].x = 10;
points[0].y = 10;
uint32_t vales [1];
vals[0] = 0x394dfe;
xcb_change_gc (c, gc, XCB_GC_FOREGROUND, vales);
xcb_poly_point (c, XCB_COORD_MODE_ORIGIN, pix, gc, 1, points);
//}*/
while (1){
//XCopyArea(disp, pix, root, gc, 0, 0, width - 100, height - 100,
0, 0); // offset size position#
//xcb_copy_area (c, pix, window, gc, 0, 0, 0, 0,
screen->width_in_pixels, 500);
//xcb_image_put(c, pix, gc, img, 0, 0, 0);
//xcb_copy_area (c, pix, win, gc, 0, 0, 0, 0, 100, 100);
//XFlush(disp);
xcb_flush(c);
usleep(1);
}
xcb_xfixes_destroy_region(c, region);
//xcb_free_pixmap (c, pix);
xcb_disconnect(c);
}
Regards,
~ Loki
--0000000000002089f006554c4da1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi (again),</div><div>(I accidentally forgot to subsc=
ribe to the mailing list... apologies this is my first time using one)</div=
><div><br></div><div>I've created an issue on the good ol' stack-ov=
erflow (<a href=3D"https://stackoverflow.com/q/79968617/31156477">https://s=
tackoverflow.com/q/79968617/31156477</a>) but haven't received an answe=
r that works yet...<br><br></div><div>I was hoping someone could help me fi=
gure out how i can click inside of a window and have my mouse interact with=
what's behind that window.</div><div><br></div><div>I'm doing so b=
ecause when i use xcb_copy_area it begins flickering when using large scale=
s and any windows i drag, draw over what's being drawn to the top of my=
screen, by=C2=A0xcb_copy_area. I'm essentially trying to create a nice=
little overlay which i can animate to.<br><br></div><div>Here's my cod=
e (and compile args are just below) so far;</div><div>// compile args;=C2=
=A0gcc -o pixel_xcb pixel_xcb.c -lxcb -lxcb-image -lxcb-shape -lxcb-xfixes<=
/div><div><br>// code adapted from here <a href=3D"https://xorg.freedesktop=
.org/archive/X11R7.7/doc/libxcb/tutorial/index.html#intro">https://xorg.fre=
edesktop.org/archive/X11R7.7/doc/libxcb/tutorial/index.html#intro</a><br><b=
r>// extra info here <a href=3D"https://xcb.freedesktop.org/manual/group__X=
CB____API.html">https://xcb.freedesktop.org/manual/group__XCB____API.html</=
a><br><br>// comparisons here <a href=3D"https://www.x.org/guide/xlib-and-x=
cb/#example:convertingxdpyinfoextensionqueriestoxcb">https://www.x.org/guid=
e/xlib-and-xcb/#example:convertingxdpyinfoextensionqueriestoxcb</a><br><br>=
// so can i use this to save an image and then draw it to the screen?<br>=
=C2=A0 =C2=A0 // <a href=3D"https://stackoverflow.com/questions/34176795/an=
y-efficient-way-of-converting-ximage-data-to-pixel-map-e-g-array-of-rgb-qua=
d">https://stackoverflow.com/questions/34176795/any-efficient-way-of-conver=
ting-ximage-data-to-pixel-map-e-g-array-of-rgb-quad</a><br><br>// maybe som=
ething useful for shm here <a href=3D"http://metan.ucw.cz/blog/things-i-wan=
ted-to-know-about-libxcb.html">http://metan.ucw.cz/blog/things-i-wanted-to-=
know-about-libxcb.html</a><br><br>#include <xcb/xcb.h><br>#include &l=
t;xcb/xcb_image.h> <br>#include <xcb/xproto.h><br>#include <std=
io.h><br>#include <unistd.h><br>#include <stdio.h><br>#inclu=
de <string.h><br>#include <stdlib.h><br><br>#include <xcb/sh=
ape.h><br>#include <xcb/xfixes.h><br><br>//#include "/home/lo=
ki/Documents/libxcb-errors-master/src/xcb_errors.c"<br><br><br>// clic=
k through xcb <a href=3D"https://shallowsky.com/blog/programming/translucen=
t-window-click-thru.html">https://shallowsky.com/blog/programming/transluce=
nt-window-click-thru.html</a><br><br>xcb_screen_t *screen_of_display (xcb_c=
onnection_t *c, int screen){<br>=C2=A0 xcb_screen_iterator_t iter;<br><br>=
=C2=A0 iter =3D xcb_setup_roots_iterator (xcb_get_setup (c));<br>=C2=A0 for=
(; iter.rem; --screen, xcb_screen_next (&iter))<br>=C2=A0 =C2=A0 if (s=
creen =3D=3D 0)<br>=C2=A0 =C2=A0 =C2=A0 return iter.data;<br><br>=C2=A0 ret=
urn NULL;<br>}<br><br>int main(){<br><br>// display and screen<br>=C2=A0 =
=C2=A0 int screen_default_nbr;<br>=C2=A0 =C2=A0 xcb_connection_t *c =3D xcb=
_connect (NULL, &screen_default_nbr);<br><br>// screen<br>=C2=A0 =C2=A0=
xcb_screen_t* screen =3D screen_of_display (c, screen_default_nbr);<br><br=
>// root display (screen / root window with other screens as background)<br=
>=C2=A0 =C2=A0 xcb_window_t root_window =3D { 0 };<br>=C2=A0 =C2=A0 root_wi=
ndow =3D screen->root;<br>=C2=A0 =C2=A0 <br>// gc (black)<br>=C2=A0 =C2=
=A0 uint32_t values[4];<br>=C2=A0 =C2=A0 uint32_t =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 mask =3D 0;<br>=C2=A0 =C2=A0 xcb_gcontext_t =C2=A0 =C2=A0=
=C2=A0 gc;<br>=C2=A0 =C2=A0 gc =3D xcb_generate_id (c);<br>=C2=A0 =C2=A0 m=
ask =3D XCB_GC_FUNCTION | XCB_GC_FOREGROUND | XCB_GC_BACKGROUND | XCB_GC_SU=
BWINDOW_MODE;<br>=C2=A0 =C2=A0 values[0] =3D XCB_GX_COPY;<br>=C2=A0 =C2=A0 =
values[1] =3D screen->black_pixel;<br>=C2=A0 =C2=A0 values[2] =3D screen=
->white_pixel;<br>=C2=A0 =C2=A0 values[3] =3D XCB_SUBWINDOW_MODE_INCLUDE=
_INFERIORS;<br>=C2=A0 =C2=A0 xcb_create_gc (c, gc, root_window, mask, value=
s);<br><br>// window<br>=C2=A0 =C2=A0 xcb_window_t window =3D xcb_generate_=
id (c);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xcb_create_window (c, =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Connection =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0XCB_COPY_FROM_PAREN=
T, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* depth (same as root)*/<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0window, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* window Id =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 */<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0screen->root, =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* parent window =C2=A0 =C2=A0 =C2=
=A0 */<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00, 0, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* x, y =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A015=
0, 150, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0/* width, height =C2=A0 =C2=A0 =C2=A0 */<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A010, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* border_width =C2=A0 =C2=A0 =C2=A0 =C2=A0*=
/<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0XCB_WINDOW_CLASS_INPUT_OUTPUT, /* class =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 */<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0scree=
n->root_visual, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* visual =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00, NULL )=
; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* =
masks, not used yet */<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>=C2=A0 =C2=A0=
=C2=A0 =C2=A0 const uint32_t valuess[] =3D{1};<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0//xcb_change_window_attributes (c, window, XCB_CW_OVERRIDE_REDIRE=
CT, valuess);<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 uint32_t client_major_version =3D XCB_XFIXES_MAJOR_VERSION;<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 uint32_t client_minor_version =3D XCB_XFIXES_MINOR_VER=
SION;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xcb_xfixes_query_version_cookie_t cook=
=3D xcb_xfixes_query_version(c, client_major_version, client_minor_version=
);<br><br>=C2=A0 =C2=A0 //xcb_generic_error_t *err;<br><br>=C2=A0 =C2=A0 //=
printf("%d", err->major_code);<br><br>=C2=A0 =C2=A0 xcb_xfixes=
_query_version_reply_t* rep =3D xcb_xfixes_query_version_reply(c, cook, NUL=
L);<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xcb_rectangle_t rect [1] =3D {{0, 0,=
110, 110}};<br>=C2=A0 =C2=A0 xcb_xfixes_region_t region =3D xcb_generate_i=
d(c);<br>=C2=A0 =C2=A0 xcb_xfixes_create_region(c, region, 1, rect);<br>=C2=
=A0 =C2=A0 xcb_xfixes_set_window_shape_region(c, window, 2, 0, 0, region); =
<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Map the window on the screen */<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 xcb_map_window (c, window);<br><br><br>=C2=A0 =
=C2=A0 // <a href=3D"https://stackoverflow.com/questions/16400937/click-thr=
ough-transparent-xlib-windows">https://stackoverflow.com/questions/16400937=
/click-through-transparent-xlib-windows</a><br>=C2=A0 =C2=A0 <br>=C2=A0 =C2=
=A0 /*<br>=C2=A0 =C2=A0 XRectangle rect;<br>=C2=A0 =C2=A0 XserverRegion reg=
ion =3D XFixesCreateRegion(display, &rect, 1);<br>=C2=A0 =C2=A0 XFixesS=
etWindowShapeRegion(display, window, ShapeInput, 0, 0, region);<br>=C2=A0 =
=C2=A0 XFixesDestroyRegion(display, region);*/<br><br><br>=C2=A0 =C2=A0 =C2=
=A0<br>// pixmap<br>=C2=A0 =C2=A0 /*xcb_pixmap_t pix =3D xcb_generate_id (c=
);<br>=C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 xcb_create_pixmap (c, screen->root=
_depth, =C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0pix, =C2=A0 =C2=A0 =C2=A0 /* Id of the pixmap *<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0screen->root,<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0screen->width_in_pixels,=
=C2=A0 =C2=A0 /* Width of the window (in pixels) *<br>=C2=A0 =C2=A0 =C2=A0=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0screen->height_in_pixels);<br>=C2=
=A0 =C2=A0 <br>=C2=A0 =C2=A0 uint32_t vals [1];<br>=C2=A0 =C2=A0 vals[0] =
=3D 0xffffff80;<br><br>// image<br>=C2=A0 =C2=A0 xcb_get_image_reply_t* img=
=3D xcb_get_image_reply(<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 c, <br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 xcb_get_image (<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 c,<br> =C2=A0 =C2=A0XCB_IMAGE_FORMAT_Z_PIXMAP,<br> =C2=A0 =C2=A0roo=
t_window,<br> =C2=A0 =C2=A00,<br> =C2=A0 =C2=A00,<br> =C2=A0 =C2=A010=
0,<br> =C2=A0 =C2=A0100,<br> =C2=A0 =C2=A00<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ), <br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 NULL<br>=C2=A0 =C2=A0 );<br><br>=C2=
=A0 =C2=A0 //for (int x =3D 0; x < ){<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xcb=
_point_t points [1];<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 points[0].x =3D 10;<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 points[0].y =3D 10;<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 uint32_t vales [1];<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 vals[0] =3D 0x394dfe=
;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xcb_change_gc (c, gc, XCB_GC_FOREGROUND, v=
ales);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xcb_poly_point (c, XCB_COORD_MODE_ORI=
GIN, pix, gc, 1, points);<br>=C2=A0 =C2=A0 //}*/<br><br><br>=C2=A0 =C2=A0 w=
hile (1){ =C2=A0 <br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 //XCopyArea(disp, pix, roo=
t, gc, 0, 0, width - 100, height - 100, 0, 0); // offset size position# =C2=
=A0<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 //xcb_copy_area (c, pix, window, gc, 0, =
0, 0, 0, screen->width_in_pixels, 500);<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 //xcb_image_put(c, pix, gc, img, 0, 0, 0); <=
br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 //xcb_copy_area (c, pix, win, gc, 0, 0, =
0, 0, 100, 100);<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 //XFlush(disp);<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 xcb_flush(c);<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 u=
sleep(1);<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br>=C2=A0 =C2=A0 }<br><=
br>=C2=A0 =C2=A0 <br>=C2=A0 =C2=A0 xcb_xfixes_destroy_region(c, region); =
=C2=A0<br><br>=C2=A0 =C2=A0 //xcb_free_pixmap (c, pix); <br><br>=C2=A0 =C2=
=A0 xcb_disconnect(c);<br>}</div><div><br></div><div>Regards,</div><div>~ L=
oki</div></div>
--0000000000002089f006554c4da1--