GNOME Bugzilla – Bug 317498
Script-Fu server should suppress progress popups
Last modified: 2008-01-15 13:01:08 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.
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?
Yes, definitely. Weird..
Please attach a simple script then that shows the problem.
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).
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.
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.
If you are using GIMP in server mode, there is not going to be any user interface at all, thus no popups.
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.
Why don't you add --no-interface then?
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.
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.
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?
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?
This shouldn't be needinfo anymore.
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.
This is how I understand comment #13.
Changing summary accordingly, setting to milestone 2.4.
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.
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).