Add gtk plugin
I experimented today a bit with adding a gtk plugin.
The way I attended to achieve this would be to do more or less what Firefox currently does, which is to create a large gtk window, where the "content" empty. The content of the actual application would then mean be the main xdg_toplevel surface, and the gtk would be a larger subsurface, placed below the actual main content.
There are three major road blocks I'm currently seeing:
[ ] libdecoration needs to handle wl_display
dispatching. I added !8 (merged) for adding API for this. I realized we actually are likely to need this for the cairo backend too, or any other plugin that wants to do more than the bare minimum. For example adding timeouts, idle callbacks etc.
[ ] libdecoration needs to handle the creation of wl_display
. This is because Gtk cannot "take over" a wl_display of someone else. I'm not sure API addition to be able to do this is likely to be accepted.
[ ] glib needs to be able to export a single file descriptor so that the GMainLoop
can be integrated into other main loops. This is a fairly complex work that. See GNOME/glib#693.
The first two somewhat shifts the responsibility of handling the Wayland connection closer to libdecoration. The first one I think is eventually necessary. The second one is needed for things like Gtk, but not so much custom plugins that doesn't rely on external Wayland libraries.
The third one is fairly large chunk of work, to say the least.
@christian-rauch since you've spent time on libdecoration, do you have any opinions on this?