GIMP shouldn't steal focus for each file opened
Update by Bruno (2024/02/14)
Basically this is an enhancement request, since GIMP in indeed annoying regarding multi files opening. The ideal, according to the issues, would be if GIMP do this "in background" without interrupt user (either CLI or GUI) workflow.
NOT confuse this issue with the another regarding the almost total lack of multi files support in some situations: #364
GIMP version: 2.10.8
Operating System: Debian GNU/Linux
Package: gimp 2.10.8-2 Debian package
Description of the bug
When opening files using a command from a terminal window (not using the gimp menu), gimp steals the window manager focus every time a new file is opened, instead of opening files in the background and keeping the terminal window focused.
Reproduction
Is the bug reproducible? [Always]
Reproduction steps:
- Gimp is already open; the gimp window is minimised/hidden/unfocused in the window manager
- From a terminal window, run
gimp file1.jpg file2.jpg
Expected result: gimp should open the two image files "in the background" without changing the gimp window's current state (minimised/hidden/unfocused); the window manager focus should stay on the terminal window.
Actual result: every time a new file is opened, the gimp window is raised and steals focus (this happens both with gimp in single-window or multi-window mode)
Additional information
My window manager is icewm in focus-follows-mouse mode, but I don't think this is a wm problem. In the same environment, firefox behaves in the way I expect, e.g. if I run firefox some-url
in a terminal, the focus stays on the terminal and firefox opens the url in the background; I'd like gimp to behave in the same way.
I couldn't find a way to tweak this behaviour in the gimp command line options or in the Preferences -> Window Management panel ("Activate the focused image" is not relevant), so I guess this is hard-coded at the moment, right?
If that's the case, I'd suggest to add a new preference option ("Focus new image windows automatically"?) to implement the behaviour I expect (and keeping the current behaviour as the default, since I guess most users will still prefer that).