gtkmm  4.8.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::AppLaunchContext Class Reference

This is an implementation of Gio::AppLaunchContext that handles launching an application in a graphical context. More...

#include <gdkmm/applaunchcontext.h>

Inherits Gio::AppLaunchContext.

Public Member Functions

 AppLaunchContext (AppLaunchContext && src) noexcept
 
AppLaunchContextoperator= (AppLaunchContext && src) noexcept
 
 ~AppLaunchContext () noexcept override
 
GdkAppLaunchContext * gobj ()
 Provides access to the underlying C GObject. More...
 
const GdkAppLaunchContext * gobj () const
 Provides access to the underlying C GObject. More...
 
GdkAppLaunchContext * gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
 
Glib::RefPtr< Displayget_display ()
 Gets the Gdk::Display that context is for. More...
 
Glib::RefPtr< const Displayget_display () const
 Gets the Gdk::Display that context is for. More...
 
void set_desktop (int desktop)
 Sets the workspace on which applications will be launched. More...
 
void set_timestamp (guint32 timestamp)
 Sets the timestamp of context. More...
 
void set_icon (const Glib::RefPtr< Gio::Icon > & icon)
 Sets the icon for applications that are launched with this context. More...
 
void set_icon_name (const Glib::ustring & icon_name)
 Sets the icon for applications that are launched with this context. More...
 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Display > > property_display () const
 The display that the Gdk::AppLaunchContext is on. More...
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static Glib::RefPtr< AppLaunchContextcreate ()
 

Protected Member Functions

 AppLaunchContext ()
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::AppLaunchContextwrap (GdkAppLaunchContext * object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Detailed Description

This is an implementation of Gio::AppLaunchContext that handles launching an application in a graphical context.

It provides startup notification and allows to launch applications on a specific screen or workspace.

Since gtkmm 3.4:

Constructor & Destructor Documentation

◆ AppLaunchContext() [1/2]

Gdk::AppLaunchContext::AppLaunchContext ( AppLaunchContext &&  src)
noexcept

◆ ~AppLaunchContext()

Gdk::AppLaunchContext::~AppLaunchContext ( )
overridenoexcept

◆ AppLaunchContext() [2/2]

Gdk::AppLaunchContext::AppLaunchContext ( )
protected

Member Function Documentation

◆ create()

static Glib::RefPtr<AppLaunchContext> Gdk::AppLaunchContext::create ( )
static

◆ get_display() [1/2]

Glib::RefPtr<Display> Gdk::AppLaunchContext::get_display ( )

Gets the Gdk::Display that context is for.

Returns
The display of context.

◆ get_display() [2/2]

Glib::RefPtr<const Display> Gdk::AppLaunchContext::get_display ( ) const

Gets the Gdk::Display that context is for.

Returns
The display of context.

◆ get_type()

static GType Gdk::AppLaunchContext::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ gobj() [1/2]

GdkAppLaunchContext* Gdk::AppLaunchContext::gobj ( )
inline

Provides access to the underlying C GObject.

◆ gobj() [2/2]

const GdkAppLaunchContext* Gdk::AppLaunchContext::gobj ( ) const
inline

Provides access to the underlying C GObject.

◆ gobj_copy()

GdkAppLaunchContext* Gdk::AppLaunchContext::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ operator=()

AppLaunchContext& Gdk::AppLaunchContext::operator= ( AppLaunchContext &&  src)
noexcept

◆ property_display()

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Display> > Gdk::AppLaunchContext::property_display ( ) const

The display that the Gdk::AppLaunchContext is on.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.

◆ set_desktop()

void Gdk::AppLaunchContext::set_desktop ( 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_DESKTOP property described in that spec.

This only works when using the X11 backend.

When the workspace is not specified or desktop is set to -1, it is up to the window manager to pick one, typically it will be the current workspace.

Parameters
desktopThe number of a workspace, or -1.

◆ set_icon()

void Gdk::AppLaunchContext::set_icon ( const Glib::RefPtr< Gio::Icon > &  icon)

Sets the icon for applications that are launched with this context.

Window Managers can use this information when displaying startup notification.

See also set_icon_name().

Parameters
iconA Gio::Icon.

◆ set_icon_name()

void Gdk::AppLaunchContext::set_icon_name ( const Glib::ustring &  icon_name)

Sets the icon for applications that are launched with this context.

The icon_name will be interpreted in the same way as the Icon field in desktop files. See also set_icon().

If both icon and icon_name are set, the icon_name takes priority. If neither icon or icon_name is set, the icon is taken from either the file that is passed to launched application or from the Gio::AppInfo for the launched application itself.

Parameters
icon_nameAn icon name.

◆ set_timestamp()

void Gdk::AppLaunchContext::set_timestamp ( guint32  timestamp)

Sets the timestamp of context.

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
timestampA timestamp.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gdk::AppLaunchContext > wrap ( GdkAppLaunchContext *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.