Implementing show_window_menu in Weston

Jonas Ã…dahl jadahl at gmail.com
Thu Nov 10 04:56:59 UTC 2016


On Wed, Nov 09, 2016 at 03:21:30PM -0800, Dima Ryazanov wrote:
> Hi,
> 
> I'd like to take a shot at implementing window menus (from xdg-shell) in
> Weston - but I don't have a good understanding of how the compositor,
> shell, etc. interact, so wanted to ask about it first.
> 
> Looks like the entry point for it would be the "show_window_menu" member of
> "shell_desktop_api" in desktop-shell/shell.c. Now, this may be a stupid
> question, but should the menu be implemented in the compositor or in the
> shell client?

The drawing should be done by the shell client. In the reference shell
implementation in weston, the compositor never does any drawing (well,
except for Xwayland window frame I suppose), and that should continue to
be the case.

> 
> I feel like it's the compositor's job, but I can't find any examples of
> drawing things or handling input in the compositor itself. If I do it in
> the desktop shell, then I could use the existing popup menu code in
> clients/window.c - but would have to add a bunch of requests to the desktop
> shell protocol just to display the menu and handle the menu items. What's
> the correct approach?

Yes, add new requests/events to the weston desktop shell protocol.
It's a private protocol so there is no need to care about any backward
compatibility.


Jonas

> 
> Thanks!

> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel



More information about the wayland-devel mailing list