Is there any example to write a wayland desktop app?

M Stoeckl wayl at mstoeckl.com
Mon Oct 25 04:43:35 UTC 2021


> I just want to write a library. Qt is good enough to be
> used to write an excellent app, but that's not my purpose. I now
> study wayland at "https://wayland-book.com/introduction.html". And I
> need a good example to get start. Even though the menu, popup and mdi
> are basic elements, they are the foundation of almost every apps.

Weston does have a fairly simple toolkit that it uses for its test
clients, which supports popup menus, but doesn't provide much more
than a window frame, and an abstract widget framework; definitely not
a multiple-document interface. Because I haven't actually used it
myself, or looked very much at its source code, I cannot say whether
this "Toytoolkit" would be a _good_ example for your purposes.

Toytoolkit uses Cairo for rendering, and much of its source code
is spread over the following files.

https://gitlab.freedesktop.org/wayland/weston/-/blob/main/clients/window.c
https://gitlab.freedesktop.org/wayland/weston/-/blob/main/shared/cairo-util.c
https://gitlab.freedesktop.org/wayland/weston/-/blob/main/shared/frame.c

Some of the more interesting clients that use this toolkit:

https://gitlab.freedesktop.org/wayland/weston/-/blob/main/clients/terminal.c
https://gitlab.freedesktop.org/wayland/weston/-/blob/main/clients/editor.c


More information about the wayland-devel mailing list