Skip to content

Feat/native wayland - #11

Open
lunar-seal wants to merge 8 commits into
SableClient:mainfrom
lunar-seal:feat/native-wayland
Open

Feat/native wayland#11
lunar-seal wants to merge 8 commits into
SableClient:mainfrom
lunar-seal:feat/native-wayland

Conversation

@lunar-seal

Copy link
Copy Markdown

Using wayland would have all kinds of benefits, such as performance, always perfect support for fractional scaling, and the polling hack for the focus tracking is not needed.

Funnily enough, while using CEF in chrome mode and then evening using the chrome native message pump, nothing relies on the tauri window being the parent of the chrome window. This means the cef views framework could be used.
Wayland support for the views framework has been available for a while: https://www.collabora.com/news-and-blog/blog/2019/05/08/cef-on-wayland-upstreamed/

So introducing wayland support isn't that hard. Tauri doesn't do this because they have to support all kinds of cases, fortunately Sable only needs this single top level window for now.

I instructed gpt 5.6 sol to implement this alongside the current X11 path and it turned out to be a pretty solid proof of concept. The basic chat experience works.
Although, there are a lot of things not working like opening links in the native browser.
Also, some cleanup is needed to avoid duplicating the entire logic on window events.
Another idea could be to just fully use the views framework for both X11 and Wayland, as the upstream approach does way more than Sable probably ever needs.

lunar-seal and others added 4 commits August 25, 2026 11:27
Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Resizable/maximizable/minimizable/closable, min/max size, and
always-on-top now reach the CEF window delegate instead of being
dropped, and frameless native Wayland windows get Tauri's
data-tauri-drag-region CSS behavior via CEF's draggable-regions API.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
The CEF Views/Ozone-Wayland windowing path is a parallel, less-hardened
alternative to the default X11 embedding path this crate has years of
focus/embedding fixes behind: single window, single webview, no raw
window handles, no runtime decoration changes. Sable, the only current
consumer, already treats the entire CEF runtime as opt-in via its own
`cef` Cargo feature (mirroring `wry`); this crate itself already gates
other non-default surfaces the same way (`devtools`, `sandbox`,
`macos-private-api`). Gate LinuxWindowing::Wayland and the
native_wayland module the same way so a consumer has to explicitly
opt in before this experimental path is even reachable, instead of it
being silently compiled into every Linux build.

Also drops a few `.clone()` calls on Copy types in native_wayland.rs
that clippy flags once the native-wayland feature actually gets built.

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@lunar-seal

lunar-seal commented Aug 25, 2026

Copy link
Copy Markdown
Author

Now it seems to work great. A wayland limitation will be the absence of window decorations, but we could just display a native looking thing up top.
I don't want to guarantee anything though, as I don't fully understand this yet.
I may spend time refining this over the next few days, but comments are appreciated.

- remove winit/x11 references
- sanity check implemented functionality
- limit impact on X11 backend to more or less zero
@lunar-seal
lunar-seal force-pushed the feat/native-wayland branch from bb64af4 to aad7f99 Compare August 27, 2026 15:20
@lunar-seal
lunar-seal marked this pull request as ready for review August 27, 2026 15:21
@lunar-seal

Copy link
Copy Markdown
Author

This should be sensible/maintainable now and be decoupled from the existing code.

@lunar-seal
lunar-seal marked this pull request as draft August 28, 2026 07:54
@lunar-seal

Copy link
Copy Markdown
Author

It's maybe possible to completely remove the cef polling too but I need to look at it properly

@lunar-seal
lunar-seal marked this pull request as ready for review August 28, 2026 16:57
@lunar-seal

Copy link
Copy Markdown
Author

I don't want to have too much complexity in one step.
I just tested with latest Sable and I dont have any issues. It's in a good state for testing as an experimental switch and to see how it works for other people.

@lunar-seal

Copy link
Copy Markdown
Author

@eleboucher

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant