Trait gtk_layer_shell::LayerShell
source · pub trait LayerShell: IsA<Window> {
Show 20 methods
// Provided methods
fn auto_exclusive_zone_enable(&self) { ... }
fn auto_exclusive_zone_is_enabled(&self) -> bool { ... }
fn is_anchor(&self, edge: Edge) -> bool { ... }
fn exclusive_zone(&self) -> i32 { ... }
fn keyboard_mode(&self) -> KeyboardMode { ... }
fn layer(&self) -> Layer { ... }
fn layer_shell_margin(&self, edge: Edge) -> i32 { ... }
fn is_keyboard_interactivity(&self) -> bool { ... }
fn monitor(&self) -> Option<Monitor> { ... }
fn namespace(&self) -> Option<GString> { ... }
fn init_layer_shell(&self) { ... }
fn is_layer_window(&self) -> bool { ... }
fn set_anchor(&self, edge: Edge, anchor_to_edge: bool) { ... }
fn set_exclusive_zone(&self, exclusive_zone: i32) { ... }
fn set_keyboard_interactivity(&self, interactivity: bool) { ... }
fn set_keyboard_mode(&self, mode: KeyboardMode) { ... }
fn set_layer(&self, layer: Layer) { ... }
fn set_layer_shell_margin(&self, edge: Edge, margin_size: i32) { ... }
fn set_monitor(&self, monitor: &Monitor) { ... }
fn set_namespace(&self, name_space: &str) { ... }
}
Provided Methods§
sourcefn auto_exclusive_zone_enable(&self)
fn auto_exclusive_zone_enable(&self)
When auto exclusive zone is enabled, exclusive zone is automatically set to the
size of the window
+ relevant margin. To disable auto exclusive zone, just set the
exclusive zone to 0 or any other fixed value.
NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored edge. This behavior is specific to gtk-layer-shell and not part of the underlying protocol
window
A layer surface.
sourcefn auto_exclusive_zone_is_enabled(&self) -> bool
fn auto_exclusive_zone_is_enabled(&self) -> bool
v0_5
only.sourcefn exclusive_zone(&self) -> i32
fn exclusive_zone(&self) -> i32
v0_5
only.sourcefn keyboard_mode(&self) -> KeyboardMode
fn keyboard_mode(&self) -> KeyboardMode
v0_6
only.sourcefn layer_shell_margin(&self, edge: Edge) -> i32
fn layer_shell_margin(&self, edge: Edge) -> i32
v0_5
only.sourcefn is_keyboard_interactivity(&self) -> bool
fn is_keyboard_interactivity(&self) -> bool
v0_5
only.Deprecated since 0.6
Use gtk_layer_get_keyboard_mode () instead.
window
A layer surface.
Returns
if keybaord interactivity is enabled
sourcefn namespace(&self) -> Option<GString>
fn namespace(&self) -> Option<GString>
v0_5
only.NOTE: this function does not return ownership of the string. Do not free the returned string. Future calls into the library may invalidate the returned string.
window
A layer surface.
Returns
a reference to the namespace property. If namespace is unset, returns the
default namespace (“gtk-layer-shell”). Never returns None
.
sourcefn init_layer_shell(&self)
fn init_layer_shell(&self)
Set the window
up to be a layer surface once it is mapped. this must be called before
the window
is realized.
window
A gtk::Window
to be turned into a layer surface.
sourcefn is_layer_window(&self) -> bool
fn is_layer_window(&self) -> bool
v0_5
only.window
A gtk::Window
that may or may not have a layer surface.
Returns
if window
has been initialized as a layer surface.
sourcefn set_anchor(&self, edge: Edge, anchor_to_edge: bool)
fn set_anchor(&self, edge: Edge, anchor_to_edge: bool)
Set whether window
should be anchored to edge
.
- If two perpendicular edges are anchored, the surface with be anchored to that corner
- If two opposite edges are anchored, the window will be stretched across the screen in that direction
Default is false
for each Edge
window
A layer surface.
edge
A Edge
this layer surface may be anchored to.
anchor_to_edge
Whether or not to anchor this layer surface to edge
.
sourcefn set_exclusive_zone(&self, exclusive_zone: i32)
fn set_exclusive_zone(&self, exclusive_zone: i32)
Has no effect unless the surface is anchored to an edge. Requests that the compositor does not place other surfaces within the given exclusive zone of the anchored edge. For example, a panel can request to not be covered by maximized windows. See wlr-layer-shell-unstable-v1.xml for details.
Default is 0
window
A layer surface.
exclusive_zone
The size of the exclusive zone.
sourcefn set_keyboard_interactivity(&self, interactivity: bool)
fn set_keyboard_interactivity(&self, interactivity: bool)
Whether the window
should receive keyboard events from the compositor.
Default is false
Deprecated since 0.6
Use gtk_layer_set_keyboard_mode () instead.
window
A layer surface.
interactivity
Whether the layer surface should receive keyboard events.
sourcefn set_keyboard_mode(&self, mode: KeyboardMode)
fn set_keyboard_mode(&self, mode: KeyboardMode)
v0_6
only.Sets if/when window
should receive keyboard events from the compositor, see
GtkLayerShellKeyboardMode for details.
Default is KeyboardMode::None
window
A layer surface.
mode
The type of keyboard interactivity requested.
sourcefn set_layer(&self, layer: Layer)
fn set_layer(&self, layer: Layer)
Set the “layer” on which the surface appears (controls if it is over top of or below other surfaces). The layer may
be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an
older version the window
is remapped so the change can take effect.
Default is Layer::Top
window
A layer surface.
layer
The layer on which this surface appears.
sourcefn set_layer_shell_margin(&self, edge: Edge, margin_size: i32)
fn set_layer_shell_margin(&self, edge: Edge, margin_size: i32)
Set the margin for a specific edge
of a window
. Effects both surface’s distance from
the edge and its exclusive zone size (if auto exclusive zone enabled).
Default is 0 for each Edge
window
A layer surface.
edge
The Edge
for which to set the margin.
margin_size
The margin for edge
to be set.
sourcefn set_monitor(&self, monitor: &Monitor)
fn set_monitor(&self, monitor: &Monitor)
Set the output for the window to be placed on, or None
to let the compositor choose.
If the window is currently mapped, it will get remapped so the change can take effect.
Default is None
window
A layer surface.
monitor
The output this layer surface will be placed on (None
to let the compositor decide).
sourcefn set_namespace(&self, name_space: &str)
fn set_namespace(&self, name_space: &str)
Set the “namespace” of the surface.
No one is quite sure what this is for, but it probably should be something generic
(“panel”, “osk”, etc). The name_space
string is copied, and caller maintains
ownership of original. If the window is currently mapped, it will get remapped so
the change can take effect.
Default is “gtk-layer-shell” (which will be used if set to None
)
window
A layer surface.
name_space
The namespace of this layer surface.