Skip to content

Commit

Permalink
Add override_redirect for X11 windows
Browse files Browse the repository at this point in the history
This commit add the `override_redirect` boolean field to the `PlatformSpecific` struct for linux platform.
This is a X11-specific flag allow bypassing window manager mapping for precise positioning of windows.
  • Loading branch information
alliby authored and hecrj committed Sep 10, 2024
1 parent abd3231 commit 01c0dbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
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,
}
10 changes: 6 additions & 4 deletions winit/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ 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.override_redirect)

Check failure on line 109 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (ubuntu-latest, stable)

no field `override_redirect` on type `iced_graphics::iced_core::window::Settings`

Check failure on line 109 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all

no field `override_redirect` on type `iced_graphics::iced_core::window::Settings`

Check failure on line 109 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all (ubuntu-latest, beta)

no field `override_redirect` on type `iced_graphics::iced_core::window::Settings`

Check failure on line 109 in winit/src/conversion.rs

View workflow job for this annotation

GitHub Actions / all

no field `override_redirect` on type `iced_graphics::iced_core::window::Settings`
.with_name(
&settings.platform_specific.application_id,
&settings.platform_specific.application_id,
);
}
#[cfg(feature = "wayland")]
{
Expand Down

0 comments on commit 01c0dbb

Please sign in to comment.