diff options
author | raveit65 <[email protected]> | 2016-06-23 16:39:30 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-06-24 20:48:20 +0200 |
commit | 9ad55d4b3af02a5416a9d2afd7512ee3318cb307 (patch) | |
tree | 0c54001edcc63b2f23e8ddd8fa50e1cff9b9d9b4 /libdocument/ev-attachment.c | |
parent | 9ea467efb4c99f4c1fec535537d0160511366b45 (diff) | |
download | atril-9ad55d4b3af02a5416a9d2afd7512ee3318cb307.tar.bz2 atril-9ad55d4b3af02a5416a9d2afd7512ee3318cb307.tar.xz |
GTK+-3: do not use gdk_app_launch_context_new()
Use gdk_display_get_app_launch_context() instead.
taken from:
https://git.gnome.org/browse/evince/commit/?id=987f7d9
Diffstat (limited to 'libdocument/ev-attachment.c')
-rw-r--r-- | libdocument/ev-attachment.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libdocument/ev-attachment.c b/libdocument/ev-attachment.c index 6e7942ee..59af21ab 100644 --- a/libdocument/ev-attachment.c +++ b/libdocument/ev-attachment.c @@ -347,7 +347,12 @@ ev_attachment_launch_app (EvAttachment *attachment, { gboolean result; GList *files = NULL; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkAppLaunchContext *context; + GdkDisplay *display; +#else GAppLaunchContext *context = NULL; +#endif GError *ioerror = NULL; g_assert (G_IS_FILE (attachment->priv->tmp_file)); @@ -355,6 +360,17 @@ ev_attachment_launch_app (EvAttachment *attachment, files = g_list_prepend (files, attachment->priv->tmp_file); +#if GTK_CHECK_VERSION (3, 0, 0) + display = screen ? gdk_screen_get_display (screen) : gdk_display_get_default (); + context = gdk_display_get_app_launch_context (display); + gdk_app_launch_context_set_screen (context, screen); + gdk_app_launch_context_set_timestamp (context, timestamp); + + result = g_app_info_launch (attachment->priv->app, files, + G_APP_LAUNCH_CONTEXT (context), + &ioerror); + g_object_unref (context); +#else context = G_APP_LAUNCH_CONTEXT (gdk_app_launch_context_new ()); gdk_app_launch_context_set_screen (GDK_APP_LAUNCH_CONTEXT (context), screen); gdk_app_launch_context_set_timestamp (GDK_APP_LAUNCH_CONTEXT (context), timestamp); @@ -364,6 +380,7 @@ ev_attachment_launch_app (EvAttachment *attachment, if (context) g_object_unref (context); +#endif if (!result) { g_set_error (error, |