Bugzilla – Bug 144322
"Save Screenshot" handles fopen failure poorly
Last modified: 2008-08-14 21:04:20 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.
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.
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/.
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.
Yes, addressing these issue, would be a major improvement.
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.
Joe, did you create a patch for this already? If not, are you still planning on creating one?
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.
Created attachment 99083 [details] work in progress patch
Screen shot dialog has been updated for 2.17.
Fixed in 10.3.