gimp r27049 - in trunk: . app/core app/gui
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27049 - in trunk: . app/core app/gui
- Date: Thu, 25 Sep 2008 08:56:58 +0000 (UTC)
Author: neo
Date: Thu Sep 25 08:56:58 2008
New Revision: 27049
URL: http://svn.gnome.org/viewvc/gimp?rev=27049&view=rev
Log:
2008-09-25 Sven Neumann <sven gimp org>
* app/core/gimp.[ch]: added a 'restored' flag to the Gimp object
and set it in gimp_real_restore(). Added method
gimp_is_restored().
* app/gui/gui.c: call gui_unique_init() in gui_init() instead of
that later in gui_restore_after_callback(). By doing so we start
our DBus service (or message proxy window on Win32) much earlier
in the start process, thus reducing the time frame where two
instances of gimp can be launched.
* app/gui/gui-unique.c
* app/gui/gimpdbusservice.c: wait handling the queued file-open
requests until gimp is fully restored.
* app/gui/splash.c (splash_update): only run one iteration of
the
main loop. Doing it in a while loop can cause us to get stuck if
the gimp-unique service already added an idle handler.
Modified:
trunk/ChangeLog
trunk/app/core/gimp.c
trunk/app/core/gimp.h
trunk/app/gui/gimpdbusservice.c
trunk/app/gui/gui-unique.c
trunk/app/gui/gui.c
trunk/app/gui/splash.c
Modified: trunk/app/core/gimp.c
==============================================================================
--- trunk/app/core/gimp.c (original)
+++ trunk/app/core/gimp.c Thu Sep 25 08:56:58 2008
@@ -186,6 +186,8 @@
gimp->stack_trace_mode = GIMP_STACK_TRACE_NEVER;
gimp->pdb_compat_mode = GIMP_PDB_COMPAT_OFF;
+ gimp->restored = FALSE;
+
gimp_gui_init (gimp);
gimp->busy = 0;
@@ -621,6 +623,8 @@
gimp_plug_in_manager_restore (gimp->plug_in_manager,
gimp_get_user_context (gimp), status_callback);
+
+ gimp->restored = TRUE;
}
static gboolean
@@ -853,6 +857,21 @@
}
/**
+ * gimp_is_restored:
+ * @gimp: a #Gimp object
+ *
+ * Return value: %TRUE if GIMP is completely started, %FALSE otherwise.
+ **/
+gboolean
+gimp_is_restored (Gimp *gimp)
+{
+ g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
+
+ return gimp->restored;
+}
+
+
+/**
* gimp_exit:
* @gimp: a #Gimp object
* @force: whether to force the application to quit
Modified: trunk/app/core/gimp.h
==============================================================================
--- trunk/app/core/gimp.h (original)
+++ trunk/app/core/gimp.h Thu Sep 25 08:56:58 2008
@@ -53,7 +53,9 @@
GimpStackTraceMode stack_trace_mode;
GimpPDBCompatMode pdb_compat_mode;
- GimpGui gui; /* gui vtable */
+ GimpGui gui; /* gui vtable */
+
+ gboolean restored; /* becomes TRUE in gimp_restore() */
gint busy;
guint busy_idle_id;
@@ -150,6 +152,7 @@
GimpInitStatusFunc status_callback);
void gimp_restore (Gimp *gimp,
GimpInitStatusFunc status_callback);
+gboolean gimp_is_restored (Gimp *gimp);
void gimp_exit (Gimp *gimp,
gboolean force);
Modified: trunk/app/gui/gimpdbusservice.c
==============================================================================
--- trunk/app/gui/gimpdbusservice.c (original)
+++ trunk/app/gui/gimpdbusservice.c Thu Sep 25 08:56:58 2008
@@ -171,9 +171,16 @@
g_return_val_if_fail (GIMP_IS_DBUS_SERVICE (service), FALSE);
+ /* We want to be called again later in case that GIMP is not fully
+ * started yet.
+ */
+ if (! gimp_is_restored (service->gimp))
+ return TRUE;
+
display = gimp_container_get_first_child (service->gimp->displays);
- gtk_window_present (GTK_WINDOW (GIMP_DISPLAY (display)->shell));
+ if (display)
+ gtk_window_present (GTK_WINDOW (GIMP_DISPLAY (display)->shell));
return TRUE;
}
@@ -194,6 +201,7 @@
{
service->source = g_idle_source_new ();
+ g_source_set_priority (service->source, G_PRIORITY_LOW);
g_source_set_callback (service->source,
(GSourceFunc) gimp_dbus_service_open_idle, service,
NULL);
@@ -215,7 +223,12 @@
static gboolean
gimp_dbus_service_open_idle (GimpDBusService *service)
{
- OpenData *data = g_queue_pop_tail (service->queue);
+ OpenData *data;
+
+ if (! service->gimp->restored)
+ return TRUE;
+
+ data = g_queue_pop_tail (service->queue);
if (data)
{
Modified: trunk/app/gui/gui-unique.c
==============================================================================
--- trunk/app/gui/gui-unique.c (original)
+++ trunk/app/gui/gui-unique.c Thu Sep 25 08:56:58 2008
@@ -55,7 +55,7 @@
static void gui_unique_win32_exit (void);
static Gimp *unique_gimp = NULL;
-static HWND proxy_window = NULL;
+static HWND proxy_window = NULL;
#endif
@@ -157,6 +157,12 @@
static gboolean
gui_unique_win32_idle_open (IdleOpenData *data)
{
+ /* We want to be called again later in case that GIMP is not fully
+ * started yet.
+ */
+ if (! gimp_is_restored (unique_gimp))
+ return TRUE;
+
if (data->name)
{
file_open_from_command_line (unique_gimp, data->name, data->as_new);
@@ -202,6 +208,7 @@
g_object_watch_closure (unique_gimp, closure);
source = g_idle_source_new ();
+ g_source_set_priority (source, G_PRIORITY_LOW);
g_source_set_closure (source, closure);
g_source_attach (source, NULL);
g_source_unref (source);
Modified: trunk/app/gui/gui.c
==============================================================================
--- trunk/app/gui/gui.c (original)
+++ trunk/app/gui/gui.c Thu Sep 25 08:56:58 2008
@@ -192,6 +192,10 @@
if (abort_message)
gui_abort (abort_message);
+ the_gui_gimp = gimp;
+
+ gui_unique_init (gimp);
+
gimp_widgets_init (gui_help_func,
gui_get_foreground_func,
gui_get_background_func,
@@ -199,8 +203,6 @@
g_type_class_ref (GIMP_TYPE_COLOR_SELECT);
- the_gui_gimp = gimp;
-
/* disable automatic startup notification */
gtk_window_set_auto_startup_notification (FALSE);
@@ -512,8 +514,6 @@
display = GIMP_DISPLAY (gimp_create_display (gimp,
NULL, GIMP_UNIT_PIXEL, 1.0));
- gui_unique_init (gimp);
-
if (gui_config->restore_session)
session_restore (gimp);
Modified: trunk/app/gui/splash.c
==============================================================================
--- trunk/app/gui/splash.c (original)
+++ trunk/app/gui/splash.c Thu Sep 25 08:56:58 2008
@@ -252,7 +252,7 @@
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (splash->progress),
percentage);
- while (gtk_events_pending ())
+ if (gtk_events_pending ())
gtk_main_iteration ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]