pub trait XwmHandler {
Show 26 methods
// Required methods
fn xwm_state(&mut self, xwm: XwmId) -> &mut X11Wm;
fn new_window(&mut self, xwm: XwmId, window: X11Surface);
fn new_override_redirect_window(&mut self, xwm: XwmId, window: X11Surface);
fn map_window_request(&mut self, xwm: XwmId, window: X11Surface);
fn mapped_override_redirect_window(
&mut self,
xwm: XwmId,
window: X11Surface,
);
fn unmapped_window(&mut self, xwm: XwmId, window: X11Surface);
fn destroyed_window(&mut self, xwm: XwmId, window: X11Surface);
fn configure_request(
&mut self,
xwm: XwmId,
window: X11Surface,
x: Option<i32>,
y: Option<i32>,
w: Option<u32>,
h: Option<u32>,
reorder: Option<Reorder>,
);
fn configure_notify(
&mut self,
xwm: XwmId,
window: X11Surface,
geometry: Rectangle<i32, Logical>,
above: Option<X11Window>,
);
fn resize_request(
&mut self,
xwm: XwmId,
window: X11Surface,
button: u32,
resize_edge: ResizeEdge,
);
fn move_request(&mut self, xwm: XwmId, window: X11Surface, button: u32);
// Provided methods
fn map_window_notify(&mut self, xwm: XwmId, window: X11Surface) { ... }
fn property_notify(
&mut self,
xwm: XwmId,
window: X11Surface,
property: WmWindowProperty,
) { ... }
fn maximize_request(&mut self, xwm: XwmId, window: X11Surface) { ... }
fn unmaximize_request(&mut self, xwm: XwmId, window: X11Surface) { ... }
fn fullscreen_request(&mut self, xwm: XwmId, window: X11Surface) { ... }
fn unfullscreen_request(&mut self, xwm: XwmId, window: X11Surface) { ... }
fn minimize_request(&mut self, xwm: XwmId, window: X11Surface) { ... }
fn unminimize_request(&mut self, xwm: XwmId, window: X11Surface) { ... }
fn active_window_request(
&mut self,
xwm: XwmId,
window: X11Surface,
timestamp: u32,
currently_active_window: Option<X11Surface>,
) { ... }
fn allow_selection_access(
&mut self,
xwm: XwmId,
selection: SelectionTarget,
) -> bool { ... }
fn send_selection(
&mut self,
xwm: XwmId,
selection: SelectionTarget,
mime_type: String,
fd: OwnedFd,
) { ... }
fn new_selection(
&mut self,
xwm: XwmId,
selection: SelectionTarget,
mime_types: Vec<String>,
) { ... }
fn cleared_selection(&mut self, xwm: XwmId, selection: SelectionTarget) { ... }
fn randr_primary_output_change(
&mut self,
xwm: XwmId,
output_name: Option<String>,
) { ... }
fn disconnected(&mut self, _xwm: XwmId) { ... }
}xwayland only.Expand description
Handler trait for X11Wm interactions
Required Methods§
Sourcefn new_window(&mut self, xwm: XwmId, window: X11Surface)
fn new_window(&mut self, xwm: XwmId, window: X11Surface)
A new X11 window was created.
New windows are not mapped yet, but various information is already accessible. In general new windows will either stay in this state, if they serve secondary purposes or request to be mapped shortly afterwards.
Sourcefn new_override_redirect_window(&mut self, xwm: XwmId, window: X11Surface)
fn new_override_redirect_window(&mut self, xwm: XwmId, window: X11Surface)
A new X11 window with the override redirect flag.
New override_redirect windows are not mapped yet, but can become any time. Window manager are not supposed to manage these windows and thus cannot intercept most operations (including mapping).
It is best to replicate their state in smithay as faithfully as possible (e.g. positioning) and don’t touch their state in any way.
Sourcefn map_window_request(&mut self, xwm: XwmId, window: X11Surface)
fn map_window_request(&mut self, xwm: XwmId, window: X11Surface)
Window requests to be mapped.
To grant the wish you have to call X11Surface::set_mapped(true) for the window to become visible.
Sourcefn mapped_override_redirect_window(&mut self, xwm: XwmId, window: X11Surface)
fn mapped_override_redirect_window(&mut self, xwm: XwmId, window: X11Surface)
Override redirect window was mapped.
This is a notification. The XWM cannot prohibit override redirect windows to become mapped.
Sourcefn unmapped_window(&mut self, xwm: XwmId, window: X11Surface)
fn unmapped_window(&mut self, xwm: XwmId, window: X11Surface)
Window was unmapped.
Sourcefn destroyed_window(&mut self, xwm: XwmId, window: X11Surface)
fn destroyed_window(&mut self, xwm: XwmId, window: X11Surface)
Window was destroyed
Sourcefn configure_request(
&mut self,
xwm: XwmId,
window: X11Surface,
x: Option<i32>,
y: Option<i32>,
w: Option<u32>,
h: Option<u32>,
reorder: Option<Reorder>,
)
fn configure_request( &mut self, xwm: XwmId, window: X11Surface, x: Option<i32>, y: Option<i32>, w: Option<u32>, h: Option<u32>, reorder: Option<Reorder>, )
Window asks to be positioned or sized differently.
Requests can be granted by calling X11Surface::configure with updated values.
Sourcefn configure_notify(
&mut self,
xwm: XwmId,
window: X11Surface,
geometry: Rectangle<i32, Logical>,
above: Option<X11Window>,
)
fn configure_notify( &mut self, xwm: XwmId, window: X11Surface, geometry: Rectangle<i32, Logical>, above: Option<X11Window>, )
Window was reconfigured.
This call will be done as a notification for both normal and override-redirect windows. Override-redirect windows can modify their size, position and stack order at any time and the compositor should properly reflect these new values to avoid bugs.
Sourcefn resize_request(
&mut self,
xwm: XwmId,
window: X11Surface,
button: u32,
resize_edge: ResizeEdge,
)
fn resize_request( &mut self, xwm: XwmId, window: X11Surface, button: u32, resize_edge: ResizeEdge, )
Window requests to be resized.
The window will be holding a grab on the mouse button provided and requests to be resized on the edges passed.
Sourcefn move_request(&mut self, xwm: XwmId, window: X11Surface, button: u32)
fn move_request(&mut self, xwm: XwmId, window: X11Surface, button: u32)
Window requests to be moved.
The window will be holding a grab on the mouse button provided.
Provided Methods§
Sourcefn map_window_notify(&mut self, xwm: XwmId, window: X11Surface)
fn map_window_notify(&mut self, xwm: XwmId, window: X11Surface)
Notification a window was mapped sucessfully
Sourcefn property_notify(
&mut self,
xwm: XwmId,
window: X11Surface,
property: WmWindowProperty,
)
fn property_notify( &mut self, xwm: XwmId, window: X11Surface, property: WmWindowProperty, )
A window property has changed.
Sourcefn maximize_request(&mut self, xwm: XwmId, window: X11Surface)
fn maximize_request(&mut self, xwm: XwmId, window: X11Surface)
Window requests to be maximized.
Sourcefn unmaximize_request(&mut self, xwm: XwmId, window: X11Surface)
fn unmaximize_request(&mut self, xwm: XwmId, window: X11Surface)
Window requests to be unmaximized.
Sourcefn fullscreen_request(&mut self, xwm: XwmId, window: X11Surface)
fn fullscreen_request(&mut self, xwm: XwmId, window: X11Surface)
Window requests to be fullscreened.
Sourcefn unfullscreen_request(&mut self, xwm: XwmId, window: X11Surface)
fn unfullscreen_request(&mut self, xwm: XwmId, window: X11Surface)
Window requests to be unfullscreened.
Sourcefn minimize_request(&mut self, xwm: XwmId, window: X11Surface)
fn minimize_request(&mut self, xwm: XwmId, window: X11Surface)
Window requests to be minimized.
Sourcefn unminimize_request(&mut self, xwm: XwmId, window: X11Surface)
fn unminimize_request(&mut self, xwm: XwmId, window: X11Surface)
Window requests to be unminimized.
Sourcefn active_window_request(
&mut self,
xwm: XwmId,
window: X11Surface,
timestamp: u32,
currently_active_window: Option<X11Surface>,
)
fn active_window_request( &mut self, xwm: XwmId, window: X11Surface, timestamp: u32, currently_active_window: Option<X11Surface>, )
Window requests to be set as active window.
A client may include a currently_active_window in the request to
indicate this is a focus change from another window by the same client.
Sourcefn allow_selection_access(
&mut self,
xwm: XwmId,
selection: SelectionTarget,
) -> bool
fn allow_selection_access( &mut self, xwm: XwmId, selection: SelectionTarget, ) -> bool
Window requests access to the given selection.
Sourcefn send_selection(
&mut self,
xwm: XwmId,
selection: SelectionTarget,
mime_type: String,
fd: OwnedFd,
)
fn send_selection( &mut self, xwm: XwmId, selection: SelectionTarget, mime_type: String, fd: OwnedFd, )
The given selection is being read by an X client and needs to be written to the provided file descriptor
Sourcefn new_selection(
&mut self,
xwm: XwmId,
selection: SelectionTarget,
mime_types: Vec<String>,
)
fn new_selection( &mut self, xwm: XwmId, selection: SelectionTarget, mime_types: Vec<String>, )
A new selection was set by an X client with provided mime_types
Sourcefn cleared_selection(&mut self, xwm: XwmId, selection: SelectionTarget)
fn cleared_selection(&mut self, xwm: XwmId, selection: SelectionTarget)
A proviously set selection of an X client got cleared
Sourcefn randr_primary_output_change(
&mut self,
xwm: XwmId,
output_name: Option<String>,
)
fn randr_primary_output_change( &mut self, xwm: XwmId, output_name: Option<String>, )
The primary output of the randr protocol state was updated
Sourcefn disconnected(&mut self, _xwm: XwmId)
fn disconnected(&mut self, _xwm: XwmId)
WM has lost connection to X server