Skip to content

Make it possible to build examples with just X11 / just Wayland - #311

Merged
madsmtm merged 1 commit into
masterfrom
madsmtm/examples-just-x11-wayland
Jan 17, 2026
Merged

madsmtm merged 1 commit into
masterfrom
madsmtm/examples-just-x11-wayland

Conversation

@madsmtm

@madsmtm madsmtm commented Jan 17, 2026

Copy link
Copy Markdown
Member

No description provided.

@madsmtm madsmtm added documentation Improvements or additions to documentation DS - Wayland DS - X11 Xlib / Xcb backend labels Jan 17, 2026
Comment thread Cargo.toml
Comment on lines +29 to +30
"winit/wayland",
"winit/wayland-csd-adwaita",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Winit is a dev-dependency, so even though we add it to top-level features table here, it will be ignored in downstream applications.

@madsmtm
madsmtm force-pushed the madsmtm/examples-just-x11-wayland branch from 5821463 to 0e62594 Compare January 17, 2026 08:41
@madsmtm
madsmtm force-pushed the madsmtm/examples-just-x11-wayland branch from 0e62594 to e9ed718 Compare January 17, 2026 08:41
@madsmtm
madsmtm merged commit 5abd560 into master Jan 17, 2026
40 checks passed
@madsmtm
madsmtm deleted the madsmtm/examples-just-x11-wayland branch January 17, 2026 09:06
@MarijnS95

Copy link
Copy Markdown
Member

A more informative description PR description at all would have been nice. We already "supported" building with just the X11/Wayland features, but that (for examples / dev-dependencies) accidentally used to pull in the entire dependency stack via winit which you now tidied up. Did that cause any compile-time issues? Or just runtime issues when winit defaults to a Wayland connection while softbuffer only had the X11 backend enabled and "vice-versa"?

@madsmtm

madsmtm commented Jan 20, 2026 •

Copy link
Copy Markdown
Member Author

A more informative description PR description at all would have been nice.

Sorry, I thought the title was descriptive enough (and that it was a mostly inconsequential change anyhow).

We already "supported" building with just the X11/Wayland features, but that (for examples / dev-dependencies) accidentally used to pull in the entire dependency stack via winit which you now tidied up. Did that cause any compile-time issues? Or just runtime issues when winit defaults to a Wayland connection while softbuffer only had the X11 backend enabled and "vice-versa"?

With default features enabled for Winit, it defaults to Wayland, which means it provides a WaylandDisplayHandle/WaylandWindowHandle to Softbuffer, which, when Softbuffer is compiled without support for Wayland, panics.

I know that you can use WAYLAND_DISPLAY or DISPLAY or smth to make Winit use the X11 backend in that case, but it was sometimes a bit annoying for my setup (and I also haven't read up on what I actually need to set those values to to force X11).

@MarijnS95

Copy link
Copy Markdown
Member

With default features enabled for Winit, it defaults to Wayland, which means it provides a WaylandDisplayHandle/WaylandWindowHandle to Softbuffer, which, when Softbuffer is compiled without support for Wayland, panics.

Yeah, exactly. That's the context I guessed from the changes, but this situation didn't immediately become clear from the title and missing description.

Indeed I meant that building softbuffer with a specific backend (before this fix) also had to be started/controlled with those environment variables to ensure winit uses a matching backend too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation DS - Wayland DS - X11 Xlib / Xcb backend

Development

Successfully merging this pull request may close these issues.

2 participants