<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk4-Application-launching">
<refmeta>
<refentrytitle role="top_of_page" id="gdk4-Application-launching.top_of_page">Application launching</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Application launching</refname>
<refpurpose>Startup notification for applications</refpurpose>
</refnamediv>

<refsect1 id="gdk4-Application-launching.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-app-launch-context-get-display">gdk_app_launch_context_get_display</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-app-launch-context-set-desktop">gdk_app_launch_context_set_desktop</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-app-launch-context-set-timestamp">gdk_app_launch_context_set_timestamp</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-app-launch-context-set-icon">gdk_app_launch_context_set_icon</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-app-launch-context-set-icon-name">gdk_app_launch_context_set_icon_name</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-Application-launching.properties" role="properties">
<title role="properties.title">Properties</title>
<informaltable frame="none">
<tgroup cols="3">
<colspec colname="properties_type" colwidth="150px"/>
<colspec colname="properties_name" colwidth="300px"/>
<colspec colname="properties_flags" colwidth="200px"/>
<tbody>
<row><entry role="property_type"><link linkend="GdkDisplay"><type>GdkDisplay</type></link>&#160;*</entry><entry role="property_name"><link linkend="GdkAppLaunchContext--display">display</link></entry><entry role="property_flags">Read / Write / Construct&#160;Only</entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<anchor id="GdkAppLaunchContext"/><refsect1 id="gdk4-Application-launching.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkAppLaunchContext-struct">GdkAppLaunchContext</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-Application-launching.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> <link linkend="GAppLaunchContext">GAppLaunchContext</link>
        <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GdkAppLaunchContext
</screen>
</refsect1>

<refsect1 id="gdk4-Application-launching.includes"><title>Includes</title><synopsis>#include &lt;gdk/gdk.h&gt;
</synopsis></refsect1>

<refsect1 id="gdk4-Application-launching.description" role="desc">
<title role="desc.title">Description</title>
<para>GdkAppLaunchContext is an implementation of <link linkend="GAppLaunchContext"><type>GAppLaunchContext</type></link> that
handles launching an application in a graphical context. It provides
startup notification and allows to launch applications on a specific
screen or workspace.</para>
<refsect3><title>Launching an application</title><informalexample><programlisting role="example"><![CDATA[
GdkAppLaunchContext *context;

context = gdk_display_get_app_launch_context (display);

gdk_app_launch_context_set_display (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);
]]></programlisting></informalexample>
<para></para>
</refsect3>

</refsect1>
<refsect1 id="gdk4-Application-launching.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-app-launch-context-get-display" role="function">
<title>gdk_app_launch_context_get_display&#160;()</title>
<indexterm zone="gdk-app-launch-context-get-display"><primary>gdk_app_launch_context_get_display</primary></indexterm>
<programlisting language="C"><link linkend="GdkDisplay"><returnvalue>GdkDisplay</returnvalue></link>&#160;*
gdk_app_launch_context_get_display (<parameter><link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link> *context</parameter>);</programlisting>
<para>Gets the <link linkend="GdkDisplay"><type>GdkDisplay</type></link> that <parameter>context</parameter>
 is for.</para>
<refsect3 id="gdk-app-launch-context-get-display.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-app-launch-context-get-display.returns" role="returns">
<title>Returns</title>
<para>the display of <parameter>context</parameter>
. </para>
<para><emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></para>
</refsect3></refsect2>
<refsect2 id="gdk-app-launch-context-set-desktop" role="function">
<title>gdk_app_launch_context_set_desktop&#160;()</title>
<indexterm zone="gdk-app-launch-context-set-desktop"><primary>gdk_app_launch_context_set_desktop</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_app_launch_context_set_desktop (<parameter><link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link> *context</parameter>,
                                    <parameter><link linkend="int"><type>int</type></link> desktop</parameter>);</programlisting>
<para>Sets the workspace on which applications will be launched when
using this context when running under a window manager that
supports multiple workspaces, as described in the
<ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended Window Manager Hints</ulink>.</para>
<para>When the workspace is not specified or <parameter>desktop</parameter>
 is set to -1,
it is up to the window manager to pick one, typically it will
be the current workspace.</para>
<refsect3 id="gdk-app-launch-context-set-desktop.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>desktop</para></entry>
<entry role="parameter_description"><para>the number of a workspace, or -1</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-app-launch-context-set-timestamp" role="function">
<title>gdk_app_launch_context_set_timestamp&#160;()</title>
<indexterm zone="gdk-app-launch-context-set-timestamp"><primary>gdk_app_launch_context_set_timestamp</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_app_launch_context_set_timestamp (<parameter><link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link> *context</parameter>,
                                      <parameter><link linkend="guint32"><type>guint32</type></link> timestamp</parameter>);</programlisting>
<para>Sets the timestamp of <parameter>context</parameter>
. The timestamp should ideally
be taken from the event that triggered the launch.</para>
<para>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'.</para>
<refsect3 id="gdk-app-launch-context-set-timestamp.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>timestamp</para></entry>
<entry role="parameter_description"><para>a timestamp</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-app-launch-context-set-icon" role="function">
<title>gdk_app_launch_context_set_icon&#160;()</title>
<indexterm zone="gdk-app-launch-context-set-icon"><primary>gdk_app_launch_context_set_icon</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_app_launch_context_set_icon (<parameter><link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link> *context</parameter>,
                                 <parameter><link linkend="GIcon"><type>GIcon</type></link> *icon</parameter>);</programlisting>
<para>Sets the icon for applications that are launched with this
context.</para>
<para>Window Managers can use this information when displaying startup
notification.</para>
<para>See also <link linkend="gdk-app-launch-context-set-icon-name"><function>gdk_app_launch_context_set_icon_name()</function></link>.</para>
<refsect3 id="gdk-app-launch-context-set-icon.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>icon</para></entry>
<entry role="parameter_description"><para>a <link linkend="GIcon"><type>GIcon</type></link>, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-app-launch-context-set-icon-name" role="function">
<title>gdk_app_launch_context_set_icon_name&#160;()</title>
<indexterm zone="gdk-app-launch-context-set-icon-name"><primary>gdk_app_launch_context_set_icon_name</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_app_launch_context_set_icon_name (<parameter><link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link> *context</parameter>,
                                      <parameter>const <link linkend="char"><type>char</type></link> *icon_name</parameter>);</programlisting>
<para>Sets the icon for applications that are launched with this context.
The <parameter>icon_name</parameter>
 will be interpreted in the same way as the Icon field
in desktop files. See also <link linkend="gdk-app-launch-context-set-icon"><function>gdk_app_launch_context_set_icon()</function></link>.</para>
<para>If both <parameter>icon</parameter>
 and <parameter>icon_name</parameter>
 are set, the <parameter>icon_name</parameter>
 takes priority.
If neither <parameter>icon</parameter>
 or <parameter>icon_name</parameter>
 is set, the icon is taken from either
the file that is passed to launched application or from the <link linkend="GAppInfo"><type>GAppInfo</type></link>
for the launched application itself.</para>
<refsect3 id="gdk-app-launch-context-set-icon-name.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>context</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkAppLaunchContext"><type>GdkAppLaunchContext</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>icon_name</para></entry>
<entry role="parameter_description"><para>an icon name, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></entry>
<entry role="parameter_annotations"><emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>

</refsect1>
<refsect1 id="gdk4-Application-launching.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkAppLaunchContext-struct" role="struct">
<title>GdkAppLaunchContext</title>
<indexterm zone="GdkAppLaunchContext-struct"><primary>GdkAppLaunchContext</primary></indexterm>
<programlisting language="C">typedef struct _GdkAppLaunchContext GdkAppLaunchContext;</programlisting>
<para>The GdkAppLaunchContext struct contains only private fields
and should not be accessed directly.</para>
</refsect2>

</refsect1>
<refsect1 id="gdk4-Application-launching.property-details" role="property_details">
<title role="property_details.title">Property Details</title>
<refsect2 id="GdkAppLaunchContext--display" role="property"><title>The <literal>“display”</literal> property</title>
<indexterm zone="GdkAppLaunchContext--display"><primary>GdkAppLaunchContext:display</primary></indexterm>
<programlisting>  “display”                  <link linkend="GdkDisplay"><type>GdkDisplay</type></link>&#160;*</programlisting>
<para>Display.</para><para>Owner: GdkAppLaunchContext</para>
<para>Flags: Read / Write / Construct&#160;Only</para>
</refsect2>

</refsect1>

</refentry>
