After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 317498 - Script-Fu server should suppress progress popups
Script-Fu server should suppress progress popups
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
2.2.x
Other All
: Urgent enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-09-29 10:48 UTC by Fritz Jetzek
Modified: 2008-01-15 13:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Script-Fu script to demonstrate progress popup windows while loading image files as layers (987 bytes, text/plain)
2005-10-14 10:54 UTC, Fritz Jetzek
Details

Description Fritz Jetzek 2005-09-29 10:48:17 UTC
If I have a set of images that I want to load as layers of a newly created
single image I would typically write a script-fu for it that loads each image
from the set, adds it as a layer to the result image and finally displays that
result.

Such a script would use calls to gimp-file-load for each intended layer.

However, this function displays a popup window to display the status of the
load. If the set of images to load is high these windows can be quite annoying
as they appear for each layer. 
Actually, gimp-file-load already has an INTERACTIVE/NON-INTERACTIVE switch;
using the latter option in my script I would expect that no window pops up at
all, not even that status window. I would thus suggest to only show the status
window when INTERACTIVE is set.
Alternatively, I could imagine an option in the main preferences dialog to allow
the user to decide whether she wants pop ups at all (or display the status in
the image's status bar).

Thank you for considering this report.
Comment 1 Sven Neumann 2005-09-29 18:58:36 UTC
Interactive/noninteractive has nothing to do with showing progress or not.
Script-Fu in GIMP 2.2 does however embed the progress dialogs into the script
window. Are you certainly using GIMP 2.2?
Comment 2 Fritz Jetzek 2005-10-02 11:31:43 UTC
Yes, definitely.
Weird..
Comment 3 Sven Neumann 2005-10-02 13:56:59 UTC
Please attach a simple script then that shows the problem.
Comment 4 Fritz Jetzek 2005-10-14 10:54:56 UTC
Created attachment 53455 [details]
Script-Fu script to demonstrate progress popup windows while loading image files as layers

The attached script should be run from the Script-Fu console with a syntax
similar to this:

(script-fu-bug-317498-demo "background-file.pgm" '("first-layer.pgm"
"second-layer.pgm")) 

This will load up the first file as the background layer of a newly created
image and add the remaining files as layers on top of it. 
With each load operation a progress window pops up; the point is that these
windows get annoying when a very large set of images is to be loaded (a movie,
for example).
Comment 5 Sven Neumann 2005-10-17 10:43:38 UTC
If you are running it from the console, that is not surprising. The Script-Fu
console doesn't provide a place to swallow progress bars. But I don't think
that's a problem.

The problem with your script is that it doesn't have any parameters and thus it
doesn't have a user interface. If it had one, that's where the progress bars
would go to.
Comment 6 Fritz Jetzek 2005-10-17 11:01:45 UTC
Of course the script is not primarily intended to be used from the Script-Fu
console - I just put it that way to mention the quickest way to test it.

A common scenario for the script is to be run from outside of the GIMP via the
Script-Fu server. This is a comfortable way for other (video-layers producing)
applications to use the GIMP for their output. 

But as no user interface is involved in this pipeline, popups will appear and
annoy users. 
Comment 7 Sven Neumann 2005-10-17 11:08:53 UTC
If you are using GIMP in server mode, there is not going to be any user
interface at all, thus no popups.
Comment 8 Fritz Jetzek 2005-10-17 11:36:07 UTC
I start the GIMP like this to turn on the server:

gimp --batch '(plug-in-script-fu-server 1 10008 "/home/crashcut/script-fu.log")'

I can see a user interface then.
Comment 9 Sven Neumann 2005-10-17 11:37:00 UTC
Why don't you add --no-interface then?
Comment 10 Fritz Jetzek 2005-10-17 11:57:58 UTC
After pumping data to the GIMP from an external source I want to be able to edit
it interactively. '--no-interface' doesn't permit that.
Comment 11 Sven Neumann 2005-10-17 12:00:52 UTC
The proper solution to your problem is then to export the file-open-as-layer
functionality to the PDB and to ensure that the progress of this procedure goes
to the image window if the target image has one.
Comment 12 Sven Neumann 2005-10-17 12:07:06 UTC
Actually, that isn't going to work since an image can have multiple displays. So
we can't find out where to put the progress bar. A better solution is to change
script-fu-server so that it registers a progress interface which simply does
nothing (and thus suppresses all progress bars for procedures called from it.

Would that be the desired default behaviour for the Script-Fu server?
Comment 13 Fritz Jetzek 2005-10-17 12:42:44 UTC
I'm under the impression that your previous comment #11 already solves my issue.

I can save my display variable when invoking gimp-display-new, and use that
variable to initialize the progress bar. 
Now if there are multiple displays, gimp-display-new will still return only a
single handle; progress will be shown in one of the image displays only but
that's alright IMHO.

A progress interface that does nothing is still a good idea because the
displaying of progress is time-consuming even in a single progress bar.

I'd suggest such behaviour for the server as well as an explicitly callable
function, e.g. gimp-progress-uninit or the like?

Comment 14 Michael Schumacher 2006-01-11 22:01:34 UTC
This shouldn't be needinfo anymore.
Comment 15 Sven Neumann 2006-01-11 22:26:23 UTC
So the conclusion is to suppress popups with script-fu server as described in comment #12? If so, that would probably be a trivial change.
Comment 16 Michael Schumacher 2006-01-11 22:31:09 UTC
This is how I understand comment #13.
Comment 17 Sven Neumann 2006-01-17 21:48:58 UTC
Changing summary accordingly, setting to milestone 2.4.
Comment 18 weskaggs 2006-05-21 18:46:24 UTC
Raising priority to Urgent, since according to comment #15 this would be a trivial change, and it is targeted to 2.4, which will be coming out very soon.
Comment 19 Sven Neumann 2006-05-29 12:06:55 UTC
2006-05-29  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/script-fu-server.c: suppress progress popups
	by installing progress handlers that do nothing (bug #317498).