Bug 144322

Summary: "Save Screenshot" handles fopen failure poorly
Product: [openSUSE] SUSE Linux 10.1 Reporter: Karl Eichwalder <ke>
Component: GNOMEAssignee: E-mail List <gnome-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: forgotten_CRPsQFwJ3b
Version: Beta 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Documentation Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: work in progress patch

Description Karl Eichwalder 2006-01-20 11:35:18 UTC
The "Save Screenshot" applet is very limited and does not report user errors(?).

As name it accepts /tmp/gnome.png, but as long as you do not change "Save in folder" at the same time, it silently fails.

If you change "Save in folder" to "filesystem", and enter "gnome.png" in the "Name" field, it complains about unsufficient permissions and finishes without offering a second chance.
Comment 1 Mark Gordon 2006-01-20 16:25:24 UTC
Having a "name" of /tmp/gnome.png works fine, as long as ~/Desktop/tmp/ exists and you can write to it.  It should still handle failure more gracefully, though.
Comment 2 Karl Eichwalder 2006-01-20 18:48:50 UTC
IMO, a "name" of /tmp/gnome.png should always go to the system /tmp.  Without a leading dash ("tmp/gnome.png") it should be written in ~/Desktop/tmp/.
Comment 3 Mark Gordon 2006-01-20 19:01:12 UTC
OK, so this is really three bugs:

- if the name has a leading slash, the directory should be ignored
- if the directory specified (by whatever mechanism) doesn't exist, or isn't a directory (where a symlink to a directory is treated as a directory), or if the user can't write to it, an error message should always be displayed
- if the directory has issues, as above the user should have an opportunity to choose a different directory in which to write the file.
Comment 4 Karl Eichwalder 2006-01-20 20:06:31 UTC
Yes, addressing these issue, would be a major improvement.
Comment 5 Joe Shaw 2006-04-05 22:13:48 UTC
I can't duplicate issue #1 with Beta 9.  That is, any time I provide a leading slash, it gets saved there regardless of the "Directory" setting.

I do get the poor error handling, though, and I'll whip up a patch for that.
Comment 6 Ryan Probasco 2006-09-19 14:25:39 UTC
Joe, did you create a patch for this already?  If not, are you still planning on creating one?
Comment 7 Joe Shaw 2006-09-19 15:29:11 UTC
I started on a patch but I never finished it and got sidetracked with other things.  The solution isn't as easy as it first seems, however, because gnome-screenshot is a piece of crap and doesn't check for errors in its use of gnome-vfs.

I'll attach the code I had finished, but there is more work to do.  Sadly, I don't recall what the issues are, so I'm not sure what additional work there is to be done, but you can at least use it as a reference.
Comment 8 Joe Shaw 2006-09-19 15:30:21 UTC
Created attachment 99083 [details]
work in progress patch
Comment 9 JP Rosevear 2007-02-09 21:17:13 UTC
Screen shot dialog has been updated for 2.17.
Comment 10 Forgotten User CRPsQFwJ3b 2007-11-02 16:53:18 UTC
Fixed in 10.3.