Skip to content

Commit 21f34ab

Browse files
Desktop: Enable window resize controls on Wayland compositors (#3183)
wayland client side decorations
1 parent 09bc891 commit 21f34ab

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

Cargo.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ web-sys = { version = "=0.3.77", features = [
132132
"HtmlImageElement",
133133
"ImageBitmapRenderingContext",
134134
] }
135-
winit = { git = "https://github.com/rust-windowing/winit.git", rev = "66283a79bddd034c45fb0e72c84fa5cd4e5f82fb" }
135+
winit = { git = "https://github.com/rust-windowing/winit.git", rev = "37221c7192ef1deec022a2278e54429331c01bad" }
136136
url = "2.5"
137137
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt"] }
138138
vello = { git = "https://github.com/linebender/vello.git", rev = "87cc5bee6d3a34d15017dbbb58634ddc7f33ff9b" } # TODO switch back to stable when a release is made

desktop/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ graphite-desktop-wrapper = { path = "wrapper" }
2626
graphite-desktop-embedded-resources = { path = "embedded-resources", optional = true }
2727

2828
wgpu = { workspace = true }
29-
winit = { workspace = true, features = [ "serde" ] }
29+
winit = { workspace = true, features = [ "wayland-csd-adwaita-notitlebar", "serde" ] }
3030
thiserror = { workspace = true }
3131
futures = { workspace = true }
3232
cef = { workspace = true }

desktop/src/native_window.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ impl NativeWindowHandle {
2424
.with_title(APP_NAME)
2525
.with_min_surface_size(winit::dpi::LogicalSize::new(400, 300))
2626
.with_surface_size(winit::dpi::LogicalSize::new(1200, 800))
27-
.with_resizable(true);
27+
.with_resizable(true)
28+
.with_theme(Some(winit::window::Theme::Dark));
2829

2930
#[cfg(target_os = "linux")]
3031
{
@@ -33,7 +34,7 @@ impl NativeWindowHandle {
3334
use winit::platform::wayland::WindowAttributesWayland;
3435
use winit::platform::x11::WindowAttributesX11;
3536
window = if event_loop.is_wayland() {
36-
let wayland_window = WindowAttributesWayland::default().with_name(APP_ID, "");
37+
let wayland_window = WindowAttributesWayland::default().with_name(APP_ID, "").with_prefer_csd(true);
3738
window.with_platform_attributes(Box::new(wayland_window))
3839
} else {
3940
let x11_window = WindowAttributesX11::default().with_name(APP_ID, APP_NAME);

0 commit comments

Comments
 (0)