Bug 669766

Summary: Default location to store screenshots
Product: [Fedora] Fedora Reporter: Raphael Groner <projects.rg>
Component: xfce4-screenshooterAssignee: Christoph Wickert <christoph.wickert>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: christoph.wickert, jeromeg
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-16 17:47:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
right option to select to get a file in /tmp none

Description Raphael Groner 2011-01-14 16:49:23 UTC
Description of problem:
How is it possible to change the default location for screenshots being stored to? On my system, the pictures are saved in /tmp for opening it with an external application, for instance mtPaint.

Version-Release number of selected component (if applicable):
xfce4-screenshooter-1.7.9-2.fc14.x86_64

How reproducible:
always

Steps to Reproduce:
1. Click on the panel's button for xfce4-screenshooter plugin.
2. Choose "open with mtPaint"
3. mtPaint opens the screenshot from /tmp
  
Actual results:
Folder /tmp seems to be hard coded.

Expected results:
Usage of configured folder from rc file. 
Default could be /var/cache/xfce4-screenshooter.

Additional info:
$ grep dir .config/xfce4/xfce4-screenshooter 
screenshot_dir=file:/var/tmp

Comment 1 Raphael Groner 2011-01-14 16:52:45 UTC
.config/xfce4/xfce4-screenshooter seems to remain from an older version. The fedora package does not care about that file, it even works with different permanent settings if it is not available.

Comment 2 Raphael Groner 2011-01-14 17:03:50 UTC
This seems to be very similiar to an upstream report.

http://bugzilla.xfce.org/show_bug.cgi?id=4188

Comment 3 Christoph Wickert 2011-01-14 19:32:59 UTC
The default location to store a screenshot is the last used location. Use 'Save' instead of 'Open with' and select the folder of your choice.

You still feel this is a bug we need to track?

Comment 4 Raphael Groner 2011-01-14 19:43:18 UTC
(In reply to comment #3)
Sorry, but your statement is not true. When you save individually, the folder is kept also individually and not remembered somewhere.
I am wondering where the configuration is stored, none rc file or something like that found shortly.

And as just wrote, you have to use the option "open with" instead of "save". The application opens then the temporary file *always* from /tmp. Please take a look at the upstream bug report (already closed, but not implemented well). Upstream writes something about a cli switch -p that is not available with the Fedora package.

I discussed in #fedora with nirik and others about that a little bit, they had the opinion that there was nothing checked into git, maybe forgotten for about one year till now.

If you do not understand, I can try to explain again in another way.

So please keep this bug open. Thanks :)

Comment 5 Raphael Groner 2011-01-14 19:51:45 UTC
Created attachment 473577 [details]
right option to select to get a file in /tmp

Comment 6 Christoph Wickert 2011-01-14 19:57:51 UTC
Not optimal, but I can change the value:

$ $ grep dir ~/.config/xfce4/xfce4-screenshooter 
screenshot_dir=file:/home/chris
$ xfce4-screenshooter --fullscreen -s /tmp
(doesn't matter if you save or not)
$ grep dir ~/.config/xfce4/xfce4-screenshooter 
screenshot_dir=file:/tmp
$ xfce4-screenshooter --fullscreen -s /home/chris
$ grep dir ~/.config/xfce4/xfce4-screenshooter 
screenshot_dir=file:/home/chris
$

Comment 7 Christoph Wickert 2011-01-14 20:06:14 UTC
I just re-checked it: The above is not necessary, just select 'Save' (your screenshot shows 'Open with'!) and save the file- Next time you select 'save' again, the same folder is opened.

For 'Open with' /tmp looks right to me. There is no reason to store a temporary file somewhere else but in /tmp. Even if you select 'Open with' the storage location is not changed: Next time 'Save' will open the previous location again.

The plugin only calls the xfce4-screenshooter binary with the last set options. It would be nice to have a preferences dialog for the plugin as well, but this is a usability question and I don't think our bugzilla is the right place for these discussions. Please nag upstream if you want this changed.

Comment 8 Jérôme Guelfucci 2011-01-15 12:25:01 UTC
The plugin does not call the xfce4-screenshooter binary. The plugin just uses the same shared library as xfce4-screenshooter. the plugins also have a different configuration file stored at the same location as the others panel plugins config files. And the plugin has its own configuration dialog, available by right clicking the screenshooter button and clicking on 'Properties'.

Re the original issue, yes 'Open with' saves a temporary file to /tmp and does not use the directory in the preferences. This is not a bug, it was done on purpose: the screenshot is opened, you edit it and save it where you want. Adding yet another option in the UI for that sounds a bit too much. If you think this is really a major usability issue, you can file an enhancement request on bugzilla.xfce.org and I will consider it when I have more time.

And please stop hijacking old bug reports on bugzilla.xfce.org which are not 100% relevant, always open a new bug report when in doubt.

Comment 9 Raphael Groner 2011-01-15 20:38:57 UTC
I am reopening this bug. Maybe due to my feature request.

What do you think about using a switch for ./configure to overrule the temp folder of the system (g_get_tmp_dir) that will be used? 
Example: /var/cache/xfce4-screenshooter
If there is no value set, default will be to use g_get_tmp_dir which can be never empty. If there is a value but none existing folder with the specified path, a new folder will be created if possible due to user rights. In case of error, fallback to g_get_tmp_dir.

So, it will be at least possible for the builder or maintainer to decide which logic to use. I can understand that the usage of the last used "save" folder breaks with the implemented logic so far and would probably confuse users. Anyways, this should then also be possible to force the usage of the last save folder by a special value to that switch, maybe $LAST_SAVED or somehow.

$ grep dir ~/.config/xfce4/panel/*.rc
/home/raphael/.config/xfce4/panel/screenshooter-12659957161.rc:screenshot_dir=file:/var/tmp

If you agree, I could provide a little patch. But of course, this should be discussed further in upstream.

Comment 10 Christoph Wickert 2011-01-16 07:03:46 UTC
(In reply to comment #8)
> The plugin does not call the xfce4-screenshooter binary. The plugin just uses
> the same shared library as xfce4-screenshooter. the plugins also have a
> different configuration file stored at the same location as the others panel
> plugins config files. And the plugin has its own configuration dialog,
> available by right clicking the screenshooter button and clicking on
> 'Properties'.

But as the plugin skips the "Save as" dialog, there is no way to configure the default storage location, right?

> Re the original issue, yes 'Open with' saves a temporary file to /tmp and does
> not use the directory in the preferences. This is not a bug, it was done on
> purpose: the screenshot is opened, you edit it and save it where you want.

I fully agree. 

> And please stop hijacking old bug reports on bugzilla.xfce.org which are not
> 100% relevant, always open a new bug report when in doubt.

While I agree one should not hijack old threads I think Raphael was right to speak up in this particular one. The -p switch mentioned in the bug report is not yet implemented, thus the bug is not resolved, at least not in the way that is described in the bug.


(In reply to comment #9)
> I am reopening this bug. Maybe due to my feature request.

IMHO feature requests should go into Xfce's bugzilla rather than ours.

> What do you think about using a switch for ./configure to overrule the temp
> folder of the system (g_get_tmp_dir) that will be used? 

Nothing. /tmp is the only reasonable choice for temporary data.

> So, it will be at least possible for the builder or maintainer to decide which
> logic to use. 

But this wouldn't solve your problem ether. 

> If you agree, I could provide a little patch. But of course, this should be
> discussed further in upstream.

Yeah, upstream first. What I'd like to see is an option in the properties dialog of the plugin, but this means it's no longer consistent with the binary.

Comment 11 Raphael Groner 2011-01-16 09:21:26 UTC
(In reply to comment #10)
Thanks for your comments. 
As far as I understand the issue till now and to not overcomplicate it then, the best way would be to modify the Save/Open/Upload dialog to have the possibilites to see the current path setting, change it if needed by a button click that shows the "Save as" dialog and updates the path. 
The options Open and Upload should be decoupled from the always needed save logic, so a separate only-save possibility wouldn't be needed any more. It's always possible to copy/move the picture with the file browser or choose "Save as" in an external application.
Although, I think /var/cache/xfce4-screenshooter is the better choice as a default location for screenshots, it will also make it easier to cleanup, instead of having it with other possible garbage in /tmp.

Could you please then reopen the upstream bug, also due to the non-existent -p switch? Maybe clone the bug report, it is not possible / allowed to me.

I will look for what I can do to suggest a patch to the GUI.

Comment 12 Raphael Groner 2011-01-16 15:17:32 UTC
As far as I can see, the cronjob configured in /etc/cron.daily/tmpwatch does also clean some folders under /var/cache. So no problem to use the special folder /var/cache/xfce4-screenshooter. Why not provide a special cronjob inside the xfce4-screenshooter to enhance tmpwatch configuration.

Comment 13 Raphael Groner 2011-01-16 17:47:33 UTC
Okay, now reported to upstream.

http://bugzilla.xfce.org/show_bug.cgi?id=7105