ToplevelProtocol
public protocol ToplevelProtocol : SurfaceProtocol
The ToplevelProtocol
protocol exposes the methods and properties of an underlying GdkToplevel
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Toplevel
.
Alternatively, use ToplevelRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
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.
-
Untyped pointer to the underlying
GdkToplevel
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
toplevel_ptr
Default implementationTyped pointer to the underlying
GdkToplevel
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkToplevel
instance.Declaration
Swift
var toplevel_ptr: UnsafeMutablePointer<GdkToplevel>! { get }
-
Required Initialiser for types conforming to
ToplevelProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
ToplevelPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: ToplevelPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a Toplevel property
Declaration
Swift
@inlinable func get(property: ToplevelPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a Toplevel property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: ToplevelPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
ToplevelSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ToplevelSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
ToplevelSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: ToplevelSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
computeSizeSignal
Extension methodEmitted when the size for the surface needs to be computed, when it is present.
It will normally be emitted during or after [method
Gdk.Toplevel.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 [struct
Gdk.ToplevelSize
] object. Failing to do so will result in an arbitrary size being used as a result.Note
This represents the underlyingcompute-size
signalWarning
aonComputeSize
wrapper for this signal could not be generated because it contains unimplemented features: { (2)out
orinout
argument direction is not allowed }Note
Instead, you can connectcomputeSizeSignal
using theconnect(signal:)
methodsDeclaration
Swift
static var computeSizeSignal: ToplevelSignalName { get }
Parameters
flags
Flags
unownedSelf
Reference to instance of self
size
a
GdkToplevelSize
handler
The signal handler to call
-
onNotifyDecorated(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::decorated
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyDecorated(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyDecorated
signal is emitted -
notifyDecoratedSignal
Extension methodTyped
notify::decorated
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyDecoratedSignal: ToplevelSignalName { get }
-
onNotifyDeletable(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::deletable
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyDeletable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyDeletable
signal is emitted -
notifyDeletableSignal
Extension methodTyped
notify::deletable
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyDeletableSignal: ToplevelSignalName { get }
-
onNotifyFullscreenMode(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::fullscreen-mode
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyFullscreenMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyFullscreenMode
signal is emitted -
notifyFullscreenModeSignal
Extension methodTyped
notify::fullscreen-mode
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyFullscreenModeSignal: ToplevelSignalName { get }
-
onNotifyIconList(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::icon-list
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyIconList(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyIconList
signal is emitted -
notifyIconListSignal
Extension methodTyped
notify::icon-list
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyIconListSignal: ToplevelSignalName { get }
-
onNotifyModal(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::modal
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyModal(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyModal
signal is emitted -
notifyModalSignal
Extension methodTyped
notify::modal
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyModalSignal: ToplevelSignalName { get }
-
onNotifyShortcutsInhibited(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::shortcuts-inhibited
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShortcutsInhibited(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShortcutsInhibited
signal is emitted -
notifyShortcutsInhibitedSignal
Extension methodTyped
notify::shortcuts-inhibited
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShortcutsInhibitedSignal: ToplevelSignalName { get }
-
onNotifyStartupId(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::startup-id
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyStartupId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyStartupId
signal is emitted -
notifyStartupIdSignal
Extension methodTyped
notify::startup-id
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyStartupIdSignal: ToplevelSignalName { get }
-
onNotifyState(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::state
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyState
signal is emitted -
notifyStateSignal
Extension methodTyped
notify::state
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyStateSignal: ToplevelSignalName { get }
-
onNotifyTitle(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::title
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTitle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTitle
signal is emitted -
notifyTitleSignal
Extension methodTyped
notify::title
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTitleSignal: ToplevelSignalName { get }
-
onNotifyTransientFor(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this: (C Language Example):g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::transient-for
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTransientFor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: ToplevelRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTransientFor
signal is emitted -
notifyTransientForSignal
Extension methodTyped
notify::transient-for
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTransientForSignal: ToplevelSignalName { get }
-
beginMove(device:
Extension methodbutton: x: y: timestamp: ) Begins an interactive move operation.
You might use this function to implement draggable titlebars.
Declaration
Swift
@inlinable func beginMove<DeviceT>(device: DeviceT, button: Int, x: CDouble, y: CDouble, timestamp: guint32) where DeviceT : DeviceProtocol
-
beginResize(edge:
Extension methoddevice: button: x: y: timestamp: ) Begins an interactive resize operation.
You might use this function to implement a “window resize grip.”
Declaration
Swift
@inlinable func beginResize(edge: GdkSurfaceEdge, device: DeviceRef? = nil, button: Int, x: CDouble, y: CDouble, timestamp: guint32)
-
beginResize(edge:
Extension methoddevice: button: x: y: timestamp: ) Begins an interactive resize operation.
You might use this function to implement a “window resize grip.”
Declaration
Swift
@inlinable func beginResize<DeviceT>(edge: GdkSurfaceEdge, device: DeviceT?, button: Int, x: CDouble, y: CDouble, timestamp: guint32) where DeviceT : DeviceProtocol
-
focus(timestamp:
Extension method) Sets keyboard focus to
surface
.In most cases, [method
Gtk.Window.present_with_time
] should be used on a [classGtk.Window
], rather than calling this function.Declaration
Swift
@inlinable func focus(timestamp: guint32)
-
getState()
Extension methodGets the bitwise or of the currently active surface state flags, from the
GdkToplevelState
enumeration.Declaration
Swift
@inlinable func getState() -> ToplevelState
-
inhibitSystemShortcuts(event:
Extension method) 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 [method
Gdk.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 [property
Gdk.Toplevel:shortcuts-inhibited
] property.Declaration
Swift
@inlinable func inhibitSystemShortcuts(event: EventRef? = nil)
-
inhibitSystemShortcuts(event:
Extension method) 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 [method
Gdk.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 [property
Gdk.Toplevel:shortcuts-inhibited
] property.Declaration
Swift
@inlinable func inhibitSystemShortcuts<EventT>(event: EventT?) where EventT : EventProtocol
-
lower()
Extension methodAsks to lower the
toplevel
below other windows.The windowing system may choose to ignore the request.
Declaration
Swift
@inlinable func lower() -> Bool
-
minimize()
Extension methodAsks to minimize the
toplevel
.The windowing system may choose to ignore the request.
Declaration
Swift
@inlinable func minimize() -> Bool
-
present(layout:
Extension method) Present
toplevel
after having processed theGdkToplevelLayout
rules.If the toplevel was previously not showing, it will be showed, otherwise it will change layout according to
layout
.GDK may emit the [signal
Gdk.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.
Declaration
Swift
@inlinable func present<ToplevelLayoutT>(layout: ToplevelLayoutT) where ToplevelLayoutT : ToplevelLayoutProtocol
-
restoreSystemShortcuts()
Extension methodRestore default system keyboard shortcuts which were previously inhibited.
This undoes the effect of [method
Gdk.Toplevel.inhibit_system_shortcuts
].Declaration
Swift
@inlinable func restoreSystemShortcuts()
-
set(decorated:
Extension method) Sets the toplevel to be decorated.
Setting
decorated
tofalse
hints the desktop environment that the surface has its own, client-side decorations and does not need to have window decorations added.Declaration
Swift
@inlinable func set(decorated: Bool)
-
set(deletable:
Extension method) Sets the toplevel to be deletable.
Setting
deletable
totrue
hints the desktop environment that it should offer the user a way to close the surface.Declaration
Swift
@inlinable func set(deletable: Bool)
-
setIconList(surfaces:
Extension method) 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.
Declaration
Swift
@inlinable func setIconList<ListT>(surfaces: ListT) where ListT : ListProtocol
-
set(modal:
Extension method) 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 [method
Gdk.Toplevel.set_transient_for
].Declaration
Swift
@inlinable func set(modal: Bool)
-
set(startupId:
Extension method) Sets the startup notification ID.
When using GTK, typically you should use [method
Gtk.Window.set_startup_id
] instead of this low-level function.Declaration
Swift
@inlinable func set(startupId: UnsafePointer<CChar>!)
-
set(title:
Extension method) Sets the title of a toplevel surface.
The title maybe be displayed in the titlebar, in lists of windows, etc.
Declaration
Swift
@inlinable func set(title: UnsafePointer<CChar>!)
-
setTransientFor(parent:
Extension method) Sets a transient-for parent.
Indicates to the window manager that
surface
is a transient dialog associated with the application surfaceparent
. This allows the window manager to do things like centersurface
onparent
and keepsurface
aboveparent
.See [method
Gtk.Window.set_transient_for
] if you’re using [classGtk.Window
] or [classGtk.Dialog
].Declaration
Swift
@inlinable func setTransientFor<SurfaceT>(parent: SurfaceT) where SurfaceT : SurfaceProtocol
-
showWindowMenu(event:
Extension method) 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.
Declaration
Swift
@inlinable func showWindowMenu<EventT>(event: EventT) -> Bool where EventT : EventProtocol
-
supportsEdgeConstraints()
Extension methodReturns whether the desktop environment supports tiled window states.
Declaration
Swift
@inlinable func supportsEdgeConstraints() -> Bool
-
state
Extension methodThe state of the toplevel.
Declaration
Swift
@inlinable var state: ToplevelState { get }