Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add override_redirect for X11 windows #2476

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/src/window/settings/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ pub struct PlatformSpecific {
/// As a best practice, it is suggested to select an application id that match
/// the basename of the application’s .desktop file.
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,
}
12 changes: 8 additions & 4 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ pub fn window_attributes(
{
use winit::platform::x11::WindowAttributesExtX11;

attributes = attributes.with_name(
&settings.platform_specific.application_id,
&settings.platform_specific.application_id,
);
attributes = attributes
.with_override_redirect(
settings.platform_specific.override_redirect,
)
.with_name(
&settings.platform_specific.application_id,
&settings.platform_specific.application_id,
);
}
#[cfg(feature = "wayland")]
{
Expand Down
Loading