Simple SHM Wayland Client

Marek Chalupa mchqwerty at gmail.com
Thu May 29 23:57:12 PDT 2014


Hi,


On 29 May 2014 13:59, Philip Rushik <prushik at gmail.com> wrote:

>
> On Thu, May 29, 2014 at 8:02 PM, Marek Chalupa <mchqwerty at gmail.com>
> wrote:
>
>> Hi,
>>
>> try to look at weston/tests/weston-test-client-helpers.c on the function
>> client_create(). That could be the piece of code your'e looking for.
>>
>> Regards,
>> Marek
>>
>>
> Hi, thanks for the reply,
>
> I checked out that file, but I didn't see anything in it that shed new
> light on the problem. Seemed more or less to be the same code that is in
> weston/clients/simple-shm.c
>
> I think the part of the code that I am missing is this:
>         if (display->shell) {
>                 window->xdg_surface =
>                         xdg_shell_get_xdg_surface(display->shell,
>                                                   window->surface);
>
>                 assert(window->xdg_surface);
>
>                 xdg_surface_add_listener(window->xdg_surface,
>                                          &xdg_surface_listener, window);
>
>                 xdg_surface_set_title(window->xdg_surface, "simple-shm");
>         } else if (display->fshell) {
>                 _wl_fullscreen_shell_present_surface(display->fshell,
>                                                      window->surface,
>
> _WL_FULLSCREEN_SHELL_PRESE$
>                                                      NULL);
>         } else {
>                 assert(0);
>         }
>
> xdg_surface________ stuff is not part of libwayland-client and I don't
> really fully understand what is supposed to be happening here.
> Also, _wl_fullscreen_shell_present_surface seems strange and is not
> exported by libwayland-client, and if the example code doesn't use either
> of those it has to quit.
>

These protocols are not a part of libwayland, but Weston. You can find
their specification in weston/protocol directory (those xml files) and you
can generate sources from them using wayland-scanner. Then you can link
against these sources (namely xdg-shell-protocol.c for xdg_* stuff and
fullscreen-shell-procotol.c for the another). But as far as I know, the
common wl_surface should be enough for creating a window without borders
and buttons in Weston (that's how the
weston/tests/weston-test-client-helpers.c works). So if you want to use
only libwayland-client, as you wrote before, you should not use xdg_shell
and fullscreen_shell. What you need to do is:

(connect to display and get registry)
1. bind to compositor
2. create surface from compositor
3. create shm buffer
4. set buffer's contents
5. attach the buffer to surface
6. commit the surface

Hmm, I hope I didn't forget something xD


> So I still cant figure out what my code should do here.
>
> Regards,
> --Philip
>

Marek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140530/be93acdf/attachment.html>


More information about the wayland-devel mailing list