mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
app: wait for the software to be fully initialized before processing…
… DBus calls. In particular, Aryeom would start GIMP and directly double click some image to be loaded in GIMP in the very short while when splash is visible. Previous code would wait for the `restored` flag to be TRUE. This was nearly it as we can actually start loading images as soon as the 'restore' signal has passed. Yet the flag is set in the main handler, but we actually also need the <Image> UI manager to exist, which is created in gui_restore_after_callback() (so also a 'restore' handler, yet after the main signal handler, i.e. after `restored` is set to TRUE). Without this, gui_display_create() would fail with a CRITICAL, hence file_open_with_proc_and_display() as well. I could have tried to set the `restored` flag later, maybe with some clever signal handling trick (and handle both the GUI and non-GUI cases, i.e. I cannot set the flag inside gui_restore_after_callback() as it would break the non-GUI cases). Instead I go for a simpler logics with a new `initialized` flag which is only meant to be set once, once everything has been loaded, i.e. once you can consider GIMP to be fully running hence ready to process any common runtime command.
This commit is contained in:
parent
75e6f1062e
commit
a86ed68870
3 changed files with 5 additions and 2 deletions
|
@ -351,6 +351,9 @@ app_run (const gchar *full_prog_name,
|
||||||
G_CALLBACK (app_exit_after_callback),
|
G_CALLBACK (app_exit_after_callback),
|
||||||
&run_loop);
|
&run_loop);
|
||||||
|
|
||||||
|
/* The software is now fully loaded and ready to be used. */
|
||||||
|
gimp->initialized = TRUE;
|
||||||
|
|
||||||
#ifndef GIMP_CONSOLE_COMPILATION
|
#ifndef GIMP_CONSOLE_COMPILATION
|
||||||
if (run_loop && ! no_interface)
|
if (run_loop && ! no_interface)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,6 +60,7 @@ struct _Gimp
|
||||||
GimpGui gui; /* gui vtable */
|
GimpGui gui; /* gui vtable */
|
||||||
|
|
||||||
gboolean restored; /* becomes TRUE in gimp_restore() */
|
gboolean restored; /* becomes TRUE in gimp_restore() */
|
||||||
|
gboolean initialized; /* Fully initialized (only set once at start). */
|
||||||
|
|
||||||
gint busy;
|
gint busy;
|
||||||
guint busy_idle_id;
|
guint busy_idle_id;
|
||||||
|
|
|
@ -328,14 +328,13 @@ gimp_dbus_service_process_idle (GimpDBusService *service)
|
||||||
{
|
{
|
||||||
IdleData *data;
|
IdleData *data;
|
||||||
|
|
||||||
if (! service->gimp->restored)
|
if (! service->gimp->initialized || ! service->gimp->restored)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
data = g_queue_pop_tail (service->queue);
|
data = g_queue_pop_tail (service->queue);
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (data->file)
|
if (data->file)
|
||||||
file_open_from_command_line (service->gimp, data->file, data->as_new,
|
file_open_from_command_line (service->gimp, data->file, data->as_new,
|
||||||
NULL /* FIXME monitor */);
|
NULL /* FIXME monitor */);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue