Trait gdk4::prelude::ToplevelExtManual[][src]

pub trait ToplevelExtManual {
    fn inhibit_system_shortcuts<P: AsRef<Event>>(&self, event: Option<&P>);
fn show_window_menu<P: AsRef<Event>>(&self, event: &P) -> bool;
fn connect_compute_size<F: Fn(&Toplevel, &mut ToplevelSize) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Required methods

Requests that the self inhibit the system shortcuts.

This is asking the desktop environment/windowing system to let all keyboard events reach the surface, as long as it is focused, instead of triggering system actions.

If granted, the rerouting remains active until the default shortcuts processing is restored with ToplevelExt::restore_system_shortcuts(), or the request is revoked by the desktop environment, windowing system or the user.

A typical use case for this API is remote desktop or virtual machine viewers which need to inhibit the default system keyboard shortcuts so that the remote session or virtual host gets those instead of the local environment.

The windowing system or desktop environment may ask the user to grant or deny the request or even choose to ignore the request entirely.

The caller can be notified whenever the request is granted or revoked by listening to the property::Toplevel::shortcuts-inhibited property.

event

the Event that is triggering the inhibit request, or None if none is available

Asks the windowing system to show the window menu.

The window menu is the menu shown when right-clicking the titlebar on traditional windows managed by the window manager. This is useful for windows using client-side decorations, activating it with a right-click on the window decorations.

event

a Event to show the menu for

Returns

true if the window menu was shown and false otherwise.

Emitted when the size for the surface needs to be computed, when it is present.

It will normally be emitted during or after ToplevelExt::present(), depending on the configuration received by the windowing system. It may also be emitted at any other point in time, in response to the windowing system spontaneously changing the configuration.

It is the responsibility of the toplevel user to handle this signal and compute the desired size of the toplevel, given the information passed via the ToplevelSize object. Failing to do so will result in an arbitrary size being used as a result.

Returns
size

a ToplevelSize

Implementors