Commit 1d41b98c authored by Matthias Clasen's avatar Matthias Clasen

Add deprecation guards for deprecated GdkAppLaunchContext API

Also adapt the docs to not use deprecated API.
parent 1e13b42b
......@@ -144,7 +144,7 @@
GError *error = NULL;
info = g_desktop_app_info_new ("epiphany.desktop");
context = gdk_app_launch_context_new ();
context = gdk_display_get_app_launch_context (display);
g_app_info_launch (info, NULL, context, &error);
if (error)
......
......@@ -57,7 +57,7 @@
* Use this macro to guard code that is specific to the X11-backend.
* Since GDK may be configured with multiple backends, an additional
* runtime check for the used backend is recommended:
* </para>
*
* <example>
* <title>Backend-specific code</title>
* <programlisting>
......
......@@ -41,9 +41,9 @@
* <programlisting>
* GdkAppLaunchContext *context;
*
* context = gdk_app_launch_context_new (<!-- -->);
* context = gdk_display_get_app_launch_context (display);
*
* gdk_app_launch_context_set_screen (my_screen);
* gdk_app_launch_context_set_screen (screen);
* gdk_app_launch_context_set_timestamp (event->time);
*
* if (!g_app_info_launch_default_for_uri ("http://www.gtk.org", context, &error))
......
......@@ -40,9 +40,11 @@ G_BEGIN_DECLS
GType gdk_app_launch_context_get_type (void);
#ifndef GDK_DISABLE_DEPRECATED
GdkAppLaunchContext *gdk_app_launch_context_new (void);
void gdk_app_launch_context_set_display (GdkAppLaunchContext *context,
GdkDisplay *display);
#endif
void gdk_app_launch_context_set_screen (GdkAppLaunchContext *context,
GdkScreen *screen);
void gdk_app_launch_context_set_desktop (GdkAppLaunchContext *context,
......
......@@ -2218,8 +2218,9 @@ gdk_display_real_get_app_launch_context (GdkDisplay *display)
{
GdkAppLaunchContext *ctx;
ctx = gdk_app_launch_context_new ();
gdk_app_launch_context_set_display (ctx, display);
ctx = g_object_new (GDK_TYPE_APP_LAUNCH_CONTEXT,
"display", display,
NULL);
return ctx;
}
......
......@@ -63,7 +63,7 @@ gtk_show_uri (GdkScreen *screen,
g_return_val_if_fail (uri != NULL, FALSE);
context = gdk_app_launch_context_new ();
context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
gdk_app_launch_context_set_screen (context, screen);
gdk_app_launch_context_set_timestamp (context, timestamp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment