app: Don't show Welcome Dialog if images loaded...

...on start.
Users who open GIMP with images
(such as via the command line or drag & drop)
may not want the Welcome Dialog to
appear over their image.

This patch moves the check for files to be
above the code that loads the Welcome
Dialog, so that we can pass that information
to gimp_update_auto_check ().
If files are being loaded, we don't display
the Welcome Dialog (with the exception
of on first update, so users don't miss the
update information).
This commit is contained in:
Alx Sa 2026-02-07 00:47:55 +00:00
parent fa0e95941d
commit a4b9e4c4db
3 changed files with 14 additions and 5 deletions

View file

@ -461,10 +461,15 @@ app_activate_callback (GimpCoreApp *app,
}
#endif
/* Get possible files first, so that we can check if the
* welcome dialog should be displayed
*/
filenames = gimp_core_app_get_filenames (app);
/* check for updates *after* enabling config autosave, so that the timestamp
* is saved
*/
gimp_update_auto_check (gimp->edit_config, gimp);
gimp_update_auto_check (gimp->edit_config, gimp, (filenames != NULL));
/* Setting properties to be used for the next run. */
g_object_set (gimp->edit_config,
@ -475,7 +480,6 @@ app_activate_callback (GimpCoreApp *app,
NULL);
/* Load the images given on the command-line. */
filenames = gimp_core_app_get_filenames (app);
if (filenames != NULL)
{
gint i;

View file

@ -522,7 +522,8 @@ gimp_check_updates_process_idle (gpointer data)
*/
gboolean
gimp_update_auto_check (GimpCoreConfig *config,
Gimp *gimp)
Gimp *gimp,
gboolean files_loaded)
{
gboolean is_update;
gint64 prev_update_timestamp;
@ -539,8 +540,11 @@ gimp_update_auto_check (GimpCoreConfig *config,
* version is run, display a welcome dialog and do not check for
* updates right now. Otherwise, if the user has set the welcome
* dialog to always appear on load, show the Create page on start.
* The only exception is if they intentionally opened GIMP with
* images on start.
*/
if (! gimp->no_interface)
if (! gimp->no_interface &&
(is_update || ! files_loaded))
gtk_widget_set_visible (welcome_dialog_create (gimp, is_update),
TRUE);

View file

@ -22,7 +22,8 @@
gboolean gimp_update_auto_check (GimpCoreConfig *config,
Gimp *gimp);
Gimp *gimp,
gboolean files_loaded);
void gimp_update_check (GimpCoreConfig *config);
void gimp_update_refresh (GimpCoreConfig *config);