Hi folks,

It has been asked recently how to make a non-rectangular Wayland window,
where input events (mouse clicks, touch events) would go "through" the
window and be received by windows stacked under it - think of a donut where
clicking in the center passes through.

The answer consists in using "wl_region" elements together with the
"wl_input_region" functions. The idea is to create a "wl_region" structure,
populate it with several rectangles which will determine which parts of the
surface are clickable, and then call "wl_surface_set_input_region" to make
it effective.

Here is a sample code which demonstrates that :

http://www.tarnyko.net/repo/wayland-3-shm_surface_input_regions.c

And a screenshot :

http://www.tarnyko.net/repo/wayland-3-shm_surface_input_regions.png

This is a white rectangle with a hole in the center. Clicking in the hole
will eventually activate other surfaces (here, a "weston-flower" instance).


-- 
Regards,



*Manuel BACHMANN Tizen Project VANNES-FR*
_______________________________________________
Dev mailing list
[email protected]
https://lists.tizen.org/listinfo/dev

Reply via email to