[evince] libdocument: make ev_attachment_launch_app use GdkDisplay
- From: Germán Poo-Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] libdocument: make ev_attachment_launch_app use GdkDisplay
- Date: Sat, 8 Jan 2022 02:29:45 +0000 (UTC)
commit 24be012d44711afa989a1f9b50f5e336fbd1ca4e
Author: Qiu Wenbo <qiuwenbo kylinos com cn>
Date: Thu Dec 2 11:40:31 2021 +0800
libdocument: make ev_attachment_launch_app use GdkDisplay
Signed-off-by: Qiu Wenbo <qiuwenbo kylinos com cn>
libdocument/ev-attachment.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/libdocument/ev-attachment.c b/libdocument/ev-attachment.c
index 1ad2ca711..72625b11d 100644
--- a/libdocument/ev-attachment.c
+++ b/libdocument/ev-attachment.c
@@ -367,14 +367,13 @@ ev_attachment_save (EvAttachment *attachment,
static gboolean
ev_attachment_launch_app (EvAttachment *attachment,
- GdkScreen *screen,
+ GdkDisplay *display,
guint32 timestamp,
GError **error)
{
gboolean result;
GList *files = NULL;
GdkAppLaunchContext *context;
- GdkDisplay *display;
GError *ioerror = NULL;
EvAttachmentPrivate *priv = GET_PRIVATE (attachment);
@@ -383,9 +382,8 @@ ev_attachment_launch_app (EvAttachment *attachment,
files = g_list_prepend (files, priv->tmp_file);
- display = screen ? gdk_screen_get_display (screen) : gdk_display_get_default ();
+ display = display ?: 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 (priv->app, files,
@@ -421,6 +419,7 @@ ev_attachment_open (EvAttachment *attachment,
GAppInfo *app_info;
gboolean retval = FALSE;
EvAttachmentPrivate *priv;
+ GdkDisplay *display = gdk_screen_get_display (screen);
g_return_val_if_fail (EV_IS_ATTACHMENT (attachment), FALSE);
@@ -442,7 +441,7 @@ ev_attachment_open (EvAttachment *attachment,
}
if (priv->tmp_file) {
- retval = ev_attachment_launch_app (attachment, screen,
+ retval = ev_attachment_launch_app (attachment, display,
timestamp, error);
} else {
char *basename;
@@ -468,7 +467,7 @@ ev_attachment_open (EvAttachment *attachment,
g_object_unref (priv->tmp_file);
priv->tmp_file = g_object_ref (file);
- retval = ev_attachment_launch_app (attachment, screen,
+ retval = ev_attachment_launch_app (attachment, display,
timestamp, error);
}
@@ -477,4 +476,3 @@ ev_attachment_open (EvAttachment *attachment,
return retval;
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]