Module: Gdk::Toplevel
- Defined in:
- (unknown)
Overview
A GdkToplevel is a freestanding toplevel surface.
The GdkToplevel interface provides useful APIs for interacting with
the windowing system, such as controlling maximization and size of the
surface, setting icons and transient parents for dialogs.
Instance Method Summary collapse
-
#begin_move(device, button, x, y, timestamp) ⇒ nil
Begins an interactive move operation.
-
#begin_resize(edge, device, button, x, y, timestamp) ⇒ nil
Begins an interactive resize operation.
-
#decorated=(decorated) ⇒ nil
Sets the toplevel to be decorated.
-
#deletable=(deletable) ⇒ nil
Sets the toplevel to be deletable.
-
#focus(timestamp) ⇒ nil
Sets keyboard focus to surface.
-
#icon_list=(surfaces) ⇒ nil
Sets a list of icons for the surface.
-
#inhibit_system_shortcuts(event) ⇒ nil
Requests that the toplevel inhibit the system shortcuts.
-
#lower ⇒ Boolean
Asks to lower the toplevel below other windows.
-
#minimize ⇒ Boolean
Asks to minimize the toplevel.
-
#modal=(modal) ⇒ nil
Sets the toplevel to be modal.
-
#present(layout) ⇒ nil
Present toplevel after having processed the
GdkToplevelLayoutrules. -
#restore_system_shortcuts ⇒ nil
Restore default system keyboard shortcuts which were previously inhibited.
-
#show_window_menu(event) ⇒ Boolean
Asks the windowing system to show the window menu.
-
#startup_id=(startup_id) ⇒ nil
Sets the startup notification ID.
-
#state ⇒ Gdk::ToplevelState
Gets the bitwise or of the currently active surface state flags, from the
GdkToplevelStateenumeration. -
#supports_edge_constraints ⇒ Boolean
Returns whether the desktop environment supports tiled window states.
-
#title=(title) ⇒ nil
Sets the title of a toplevel surface.
- #titlebar_gesture(gesture) ⇒ Boolean
-
#transient_for=(parent) ⇒ nil
Sets a transient-for parent.
Instance Method Details
#begin_move(device, button, x, y, timestamp) ⇒ nil
Begins an interactive move operation.
You might use this function to implement draggable titlebars.
#begin_resize(edge, device, button, x, y, timestamp) ⇒ nil
Begins an interactive resize operation.
You might use this function to implement a “window resize grip.”
#decorated=(decorated) ⇒ nil
Sets the toplevel to be decorated.
Setting decorated to false hints the desktop environment that the surface has its own, client-side decorations and does not need to have window decorations added.
#deletable=(deletable) ⇒ nil
Sets the toplevel to be deletable.
Setting deletable to true hints the desktop environment that it should offer the user a way to close the surface.
#focus(timestamp) ⇒ nil
Sets keyboard focus to surface.
In most cases, gtk_window_present_with_time() should be used on a GtkWindow, rather than calling this function.
#icon_list=(surfaces) ⇒ nil
Sets a list of icons for the surface.
One of these will be used to represent the surface in iconic form. The icon may be shown in window lists or task bars. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality.
Note that some platforms don't support surface icons.
#inhibit_system_shortcuts(event) ⇒ nil
Requests that the toplevel 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 [methodGdk.Toplevel.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 [propertyGdk.Toplevel:shortcuts-inhibited] property.
#lower ⇒ Boolean
Asks to lower the toplevel below other windows.
The windowing system may choose to ignore the request.
#minimize ⇒ Boolean
Asks to minimize the toplevel.
The windowing system may choose to ignore the request.
#modal=(modal) ⇒ nil
Sets the toplevel to be modal.
The application can use this hint to tell the window manager that a certain surface has modal behaviour. The window manager can use this information to handle modal surfaces in a special way.
You should only use this on surfaces for which you have previously called [methodGdk.Toplevel.set_transient_for].
#present(layout) ⇒ nil
Present toplevel after having processed the GdkToplevelLayout rules.
If the toplevel was previously not showing, it will be showed, otherwise it will change layout according to layout.
GDK may emit the [signalGdk.Toplevel::compute-size] signal to let the user of this toplevel compute the preferred size of the toplevel surface.
Presenting is asynchronous and the specified layout parameters are not guaranteed to be respected.
#restore_system_shortcuts ⇒ nil
Restore default system keyboard shortcuts which were previously inhibited.
This undoes the effect of [methodGdk.Toplevel.inhibit_system_shortcuts].
#show_window_menu(event) ⇒ Boolean
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.
#startup_id=(startup_id) ⇒ nil
Sets the startup notification ID.
When using GTK, typically you should use gtk_window_set_startup_id() instead of this low-level function.
#state ⇒ Gdk::ToplevelState
Gets the bitwise or of the currently active surface state flags,
from the GdkToplevelState enumeration.
#supports_edge_constraints ⇒ Boolean
Returns whether the desktop environment supports tiled window states.
#title=(title) ⇒ nil
Sets the title of a toplevel surface.
The title maybe be displayed in the titlebar, in lists of windows, etc.
#titlebar_gesture(gesture) ⇒ Boolean
#transient_for=(parent) ⇒ nil
Sets a transient-for parent.
Indicates to the window manager that surface is a transient dialog associated with the application surface parent. This allows the window manager to do things like center surface on parent and keep surface above parent.
See gtk_window_set_transient_for() if you’re using GtkWindow.