summaryrefslogtreecommitdiff
path: root/misc/gnome2-utils/patches/patch-ac
blob: f07a9bd0c9e6c3c3e906ad8ff861aa6956cce63a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$NetBSD: patch-ac,v 1.5 2007/04/11 18:06:55 drochner Exp $

--- gnome-screenshot/screenshot-save.c.orig	2007-03-10 14:19:50.000000000 +0100
+++ gnome-screenshot/screenshot-save.c
@@ -115,7 +115,8 @@ read_pipe_from_child (GIOChannel   *sour
 
       status = g_io_channel_read_line (source, &error_message, NULL, NULL, NULL);
 
-      if (status == G_IO_STATUS_NORMAL)
+      if (status == G_IO_STATUS_NORMAL
+	&& error_message != NULL && strcmp (error_message, "OK") != 0)
 	{
 	  message = g_strdup_printf ("Unable to save the screenshot to disk:\n\n%s", error_message);
 	  dialog = gtk_message_dialog_new (NULL, 0,
@@ -226,8 +227,7 @@ screenshot_save_start (GdkPixbuf    *pix
 		   ERROR_MESSAGE,
 		   strlen (ERROR_MESSAGE));
 	}
-      /* By closing the pipe, we let the main process know that we're
-       * done saving it. */
+      write (pipe_from_child[1], "OK", strlen ("OK"));
       close (pipe_from_child[1]);
       read (parent_exit_notification[0], &c, 1);
 
@@ -243,7 +243,7 @@ screenshot_save_start (GdkPixbuf    *pix
 
       channel = g_io_channel_unix_new (pipe_from_child[0]);
       g_io_add_watch (channel,
-		      G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
+		      G_IO_IN | G_IO_ERR | G_IO_NVAL,
 		      read_pipe_from_child,
 		      NULL);
       g_io_channel_unref (channel);