On Wayland, provide option for better CSD
While most compositors provide server side decorations, the GNOME does not, and won't provide them. Also Wayland clients must render client side decorations. Winit was already drawing some decorations, however they were bad looking and provided no text rendering, so the title was missing. However this commit makes use of the SCTK external frame similar to GTK's Adwaita theme supporting text rendering and looking similar to other GTK applications. Fixes #1967.
This commit is contained in:
parent
f04fa5d54f
commit
829a140d9b
9 changed files with 118 additions and 14 deletions
|
|
@ -9,8 +9,11 @@
|
|||
#[cfg(all(not(feature = "x11"), not(feature = "wayland")))]
|
||||
compile_error!("Please select a feature to build for unix: `x11`, `wayland`");
|
||||
|
||||
#[cfg(feature = "wayland")]
|
||||
use crate::window::Theme;
|
||||
#[cfg(feature = "wayland")]
|
||||
use std::error::Error;
|
||||
|
||||
use std::{collections::VecDeque, env, fmt};
|
||||
#[cfg(feature = "x11")]
|
||||
use std::{ffi::CStr, mem::MaybeUninit, os::raw::*, sync::Arc};
|
||||
|
|
@ -101,6 +104,8 @@ pub struct PlatformSpecificWindowBuilderAttributes {
|
|||
pub x11_window_types: Vec<XWindowType>,
|
||||
#[cfg(feature = "x11")]
|
||||
pub gtk_theme_variant: Option<String>,
|
||||
#[cfg(feature = "wayland")]
|
||||
pub csd_theme: Option<Theme>,
|
||||
}
|
||||
|
||||
impl Default for PlatformSpecificWindowBuilderAttributes {
|
||||
|
|
@ -121,6 +126,8 @@ impl Default for PlatformSpecificWindowBuilderAttributes {
|
|||
x11_window_types: vec![XWindowType::Normal],
|
||||
#[cfg(feature = "x11")]
|
||||
gtk_theme_variant: None,
|
||||
#[cfg(feature = "wayland")]
|
||||
csd_theme: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue