Merge pull request #2476 from alliby/master

Add `override_redirect` for X11 windows
This commit is contained in:
Héctor Ramón 2024-09-11 00:10:04 +02:00 committed by GitHub
commit 770176a4e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View file

@ -8,4 +8,10 @@ pub struct PlatformSpecific {
/// As a best practice, it is suggested to select an application id that match /// As a best practice, it is suggested to select an application id that match
/// the basename of the applications .desktop file. /// the basename of the applications .desktop file.
pub application_id: String, pub application_id: String,
/// Whether bypass the window manager mapping for x11 windows
///
/// This flag is particularly useful for creating UI elements that need precise
/// positioning and immediate display without window manager interference.
pub override_redirect: bool,
} }

View file

@ -105,10 +105,14 @@ pub fn window_attributes(
{ {
use winit::platform::x11::WindowAttributesExtX11; use winit::platform::x11::WindowAttributesExtX11;
attributes = attributes.with_name( attributes = attributes
&settings.platform_specific.application_id, .with_override_redirect(
&settings.platform_specific.application_id, settings.platform_specific.override_redirect,
); )
.with_name(
&settings.platform_specific.application_id,
&settings.platform_specific.application_id,
);
} }
#[cfg(feature = "wayland")] #[cfg(feature = "wayland")]
{ {