Is there any way to let compositor set the data in client space and then return back to client?

Wang, Quanxian quanxian.wang at intel.com
Sun Feb 9 17:57:57 PST 2014


Thanks pq. It is helpful for me. I will have a try with your idea. :)

-----Original Message-----
From: Pekka Paalanen [mailto:ppaalanen at gmail.com] 
Sent: Saturday, February 08, 2014 5:56 PM
To: Wang, Quanxian
Cc: wayland-devel at lists.freedesktop.org
Subject: Re: Is there any way to let compositor set the data in client space and then return back to client?

On Sat, 8 Feb 2014 08:19:06 +0000
"Wang, Quanxian" <quanxian.wang at intel.com> wrote:

> Hi, All
> 
> I want to allocate some space in client, and let compositor set some 
> data in this space and then return back to client.
> 
> It seems like user data mechanism.
> 
> Any way to implement that?

Not really, it's nothing like user data.

You have to make the client bind to a new protocol interface you designed, and then use events to pass the data to the client.

If you need to pass significant amounts of data, you can use a mechanism similar to passing XKB keymaps, see wl_keyboard.keymap event. There the compositor creates the shm file. If you want the shm file created by the client, you pass the file descriptor in the other direction, similar to wl_shm.create_pool, have the server fill out the memory, and then send an event to say it's done or rely on a wl_display.sync roundtrip.


Thanks,
pq


More information about the wayland-devel mailing list