Gtk, wayland and vulkan - recommended approach

Hello,

What’s the current ‘proper’ approach to do vulkan content in wayland/gtk window?
I dont want to go the libdecor route (those windows look fake and resizing area is always too large),
I was hoping to do a standard gtk app that would render vulkan content maybe through a custom widget, but I dont know if gtk supports that kind of thing (without having to render into a texture and feed manually into gtk widnow compositor)

Hi,

That sounds awfully complex…

If you want to use native window decorations provided by your WM, just call:

g_setenv("GTK_CSD", "0", TRUE);

at the start of your app.

And of course, don’t use gtk_window_set_titlebar afterwards, that will force using CSD.

Yeah, I’m already getting a beatufully decorated window when I create a standard gtk window. (I first tried to do a raw wayland window and got into a dead-end with the decorations.)
My question is rather how to integrate vulkan surface into the native gtk widnow.
If I just grab the wl_surface from the window, and try to use it for my rendering - it crashes the app because it seems to conflict with gtk’s own vulkan context.
So I assumed I need to do something like GLArea widget, but last time I saw VulkanArea widget mentioned was on some deprecated roadmap list, so I’m just not sure what the current intented way is.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.