Class AppLaunchContext
- All Implemented Interfaces:
Proxy
It is an implementation of GAppLaunchContext that provides startup
notification and allows to launch applications on a specific workspace.
Launching an application
GdkAppLaunchContext *context;
context = gdk_display_get_app_launch_context (display);
gdk_app_launch_context_set_timestamp (gdk_event_get_time (event));
if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
g_warning ("Launching failed: %s\\n", error->message);
g_object_unref (context);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAppLaunchContext.Builder<B extends AppLaunchContext.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class org.gnome.gio.AppLaunchContext
AppLaunchContext.AppLaunchContextClass, AppLaunchContext.LaunchedCallback, AppLaunchContext.LaunchFailedCallback, AppLaunchContext.LaunchStartedCallbackNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new AppLaunchContext.AppLaunchContext(MemorySegment address) Create a AppLaunchContext proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected AppLaunchContextasParent()Returns this instance as if it were its parent type.static AppLaunchContext.Builder<? extends AppLaunchContext.Builder> builder()AAppLaunchContext.Builderobject constructs aAppLaunchContextwith the specified properties.Gets theGdkDisplaythat this AppLaunchContext is for.static @Nullable TypegetType()Get the GType of the AppLaunchContext classvoidsetDesktop(int desktop) Sets the workspace on which applications will be launched.voidSets the icon for applications that are launched with this context.voidsetIconName(@Nullable String iconName) Sets the icon for applications that are launched with this context.voidsetTimestamp(int timestamp) Sets the timestamp ofcontext.Methods inherited from class org.gnome.gio.AppLaunchContext
emitLaunched, emitLaunchFailed, emitLaunchStarted, getDisplay, getEnvironment, getMemoryLayout, getStartupNotifyId, launched, launchFailed, launchStarted, onLaunched, onLaunchFailed, onLaunchStarted, setenv, unsetenvMethods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AppLaunchContext
Create a AppLaunchContext proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
AppLaunchContext
public AppLaunchContext()Creates a new AppLaunchContext.
-
-
Method Details
-
getType
Get the GType of the AppLaunchContext class- Returns:
- the GType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParentin classAppLaunchContext
-
getDisplay
Gets theGdkDisplaythat this AppLaunchContext is for.- Returns:
- the display of this AppLaunchContext
-
setDesktop
public void setDesktop(int desktop) Sets the workspace on which applications will be launched.This only works when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints. Specifically this sets the
_NET_WM_DESKTOPproperty described in that spec.This only works when using the X11 backend.
When the workspace is not specified or
desktopis set to -1, it is up to the window manager to pick one, typically it will be the current workspace.- Parameters:
desktop- the number of a workspace, or -1
-
setIcon
Sets the icon for applications that are launched with this context.Window Managers can use this information when displaying startup notification.
See also
setIconName(java.lang.String).- Parameters:
icon- aGIcon
-
setIconName
Sets the icon for applications that are launched with this context.The
iconNamewill be interpreted in the same way as the Icon field in desktop files. See alsosetIcon(org.gnome.gio.Icon).If both
iconandiconNameare set, theiconNametakes priority. If neithericonoriconNameis set, the icon is taken from either the file that is passed to launched application or from theGAppInfofor the launched application itself.- Parameters:
iconName- an icon name
-
setTimestamp
public void setTimestamp(int timestamp) Sets the timestamp ofcontext.The timestamp should ideally be taken from the event that triggered the launch.
Window managers can use this information to avoid moving the focus to the newly launched application when the user is busy typing in another window. This is also known as 'focus stealing prevention'.
- Parameters:
timestamp- a timestamp
-
builder
AAppLaunchContext.Builderobject constructs aAppLaunchContextwith the specified properties. Use the variousset...()methods to set properties, and finish construction withAppLaunchContext.Builder.build().- Returns:
- the builder object
-