@ -301,6 +301,9 @@ pub struct ViewportBuilder {
pub window_level : Option < WindowLevel > ,
pub mouse_passthrough : Option < bool > ,
// X11
pub window_type : Option < X11WindowType > ,
}
impl ViewportBuilder {
@ -583,6 +586,15 @@ impl ViewportBuilder {
self
}
/// ### On X11
/// This sets the window type.
/// Maps directly to [`_NET_WM_WINDOW_TYPE`](https://specifications.freedesktop.org/wm-spec/wm-spec-1.5.html).
#[ inline ]
pub fn with_window_type ( mut self , value : X11WindowType ) -> Self {
self . window_type = Some ( value ) ;
self
}
/// Update this `ViewportBuilder` with a delta,
/// returning a list of commands and a bool indicating if the window needs to be recreated.
#[ must_use ]
@ -613,6 +625,7 @@ impl ViewportBuilder {
window_level : new_window_level ,
mouse_passthrough : new_mouse_passthrough ,
taskbar : new_taskbar ,
window_type : new_window_type ,
} = new_vp_builder ;
let mut commands = Vec ::new ( ) ;
@ -786,6 +799,11 @@ impl ViewportBuilder {
recreate_window = true ;
}
if new_window_type . is_some ( ) & & self . window_type ! = new_window_type {
self . window_type = new_window_type ;
recreate_window = true ;
}
( commands , recreate_window )
}
}
@ -799,6 +817,61 @@ pub enum WindowLevel {
AlwaysOnTop ,
}
#[ derive(Clone, Copy, Debug, Default, PartialEq, Eq) ]
#[ cfg_attr(feature = " serde " , derive(serde::Deserialize, serde::Serialize)) ]
pub enum X11WindowType {
/// This is a normal, top-level window.
#[ default ]
Normal ,
/// A desktop feature. This can include a single window containing desktop icons with the same dimensions as the
/// screen, allowing the desktop environment to have full control of the desktop, without the need for proxying
/// root window clicks.
Desktop ,
/// A dock or panel feature. Typically a Window Manager would keep such windows on top of all other windows.
Dock ,
/// Toolbar windows. "Torn off" from the main application.
Toolbar ,
/// Pinnable menu windows. "Torn off" from the main application.
Menu ,
/// A small persistent utility window, such as a palette or toolbox.
Utility ,
/// The window is a splash screen displayed as an application is starting up.
Splash ,
/// This is a dialog window.
Dialog ,
/// A dropdown menu that usually appears when the user clicks on an item in a menu bar.
/// This property is typically used on override-redirect windows.
DropdownMenu ,
/// A popup menu that usually appears when the user right clicks on an object.
/// This property is typically used on override-redirect windows.
PopupMenu ,
/// A tooltip window. Usually used to show additional information when hovering over an object with the cursor.
/// This property is typically used on override-redirect windows.
Tooltip ,
/// The window is a notification.
/// This property is typically used on override-redirect windows.
Notification ,
/// This should be used on the windows that are popped up by combo boxes.
/// This property is typically used on override-redirect windows.
Combo ,
/// This indicates the the window is being dragged.
/// This property is typically used on override-redirect windows.
Dnd ,
}
#[ derive(Clone, Copy, Default, Debug, PartialEq, Eq) ]
#[ cfg_attr(feature = " serde " , derive(serde::Deserialize, serde::Serialize)) ]
pub enum IMEPurpose {