Is iced able to draw widgets on wayland?

Is wayland able to draw widgets like this?:

Iced is modular. I think the existing render backends with with any windowing crate that exports a raw-window-handle::RawWindowHandle. For wayland you can create one from a pointer to a wl_surface and wl_display.

Which wayland compositor and which widget program do you use? Is it using an extension to the wayland protocol of your compositor or does it simply hide the window titlebar and enable transparency? If the former you will need to manually use this extension to create the wl_surface and wl_display. If the latter, winit has an option to disable the titlebar and to enable transparency.

Ah I see, thanks mate.

I don't use it yet but I am planning to use it mate :slight_smile:

In the screenshot you are showing a program that does this, right? Which program is it and how does this program handle widget drawing? Or is it a mockup you made in a photo editor?

Somebody made this using awesomeWM (all though I did do some slight editing to the colors :))

So I wanted to make something very similar but using iced but for wayland.

I see. I did a bit of searching. It seems that at least for wlroot based compositors there is the unstable wlr_layer_shell_unstable_v1 extension that you can use to force your window to be drawn below all other windows. I don't think it will be very easy to use yourself though, so maybe you will want to leave it at window_builder.with_decorations(false).with_transparent(true) and accept that you can bring the widgets to the foreground.

Official protocol description:

Unofficial protocol documentation (I think generated from the official protocol description): wlr layer shell protocol | Wayland Explorer

A C example of how to use this with GTK: GitHub - wmww/gtk-layer-shell: A library to create panels and other desktop components for Wayland using the Layer Shell protocol

1 Like

Thanks for the links mate.

Another thing, if I wanted to draw all those widgets but leaving out the taskbar, then should I draw the entire background and then the widgets and then port over to wayland.

or should i draw the widgets all separately and export each individual widgets to wayland?

I think either way will work. Not a wayland expert though.

1 Like

If I am doing the later, then how would I not have any background, for example I just want to draw a triangle directly to wayland, not drawing a triangle on the background, is this possible?

You mean transparency? You can use .with_transparent(true) when creating the window using winit and then use a color with alpha=0.0 as background color.

1 Like

Ah right, thanks mate :slight_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.