gimp r26129 - in trunk: . app/gui
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26129 - in trunk: . app/gui
- Date: Fri, 11 Jul 2008 13:56:07 +0000 (UTC)
Author: neo
Date: Fri Jul 11 13:56:07 2008
New Revision: 26129
URL: http://svn.gnome.org/viewvc/gimp?rev=26129&view=rev
Log:
2008-07-11 Sven Neumann <sven gimp org>
* app/gui/gui-unique.c: dispatch opening to an idle handler.
Modified:
trunk/ChangeLog
trunk/app/gui/gui-unique.c
Modified: trunk/app/gui/gui-unique.c
==============================================================================
--- trunk/app/gui/gui-unique.c (original)
+++ trunk/app/gui/gui-unique.c Fri Jul 11 13:56:07 2008
@@ -119,6 +119,41 @@
#ifdef G_OS_WIN32
+typedef struct
+{
+ gchar *name;
+ gboolean as_new;
+} IdleOpenData;
+
+
+static IdleOpenData *
+idle_open_data_new (const gchar *name,
+ gboolean as_new)
+{
+ IdleOpenData *data = g_slice_new (IdleOpenData, 1);
+
+ data->name = g_strdup (name);
+ data->as_new = as_new;
+
+ return data;
+}
+
+static void
+idle_open_data_free (IdleOpenData *data)
+{
+ g_free (data->name);
+ g_slice_free (IdleOpenData, data);
+}
+
+static gboolean
+gui_unique_win32_idle_open (IdleOpenData *data)
+{
+ file_open_from_command_line (unique_gimp, data->name, data->as_new);
+
+ return FALSE;
+}
+
+
LRESULT CALLBACK
gui_unique_win32_message_handler (HWND hWnd,
UINT uMsg,
@@ -131,10 +166,23 @@
{
COPYDATASTRUCT *copydata = (COPYDATASTRUCT *) lParam;
- if (copydata->cbData > 0)
- file_open_from_command_line (unique_gimp,
- copydata->lpData,
- copydata->dwData != 0);
+ if (unique_gimp && copydata->cbData > 0)
+ {
+ GSource *source;
+ GClosure *closure;
+ IdleOpenData *data = idle_open_data_new (copydata->lpData, copydata->dwData != 0);
+
+ closure = g_cclosure_new (G_CALLBACK (gui_unique_win32_idle_open),
+ data,
+ (GClosureNotify) idle_open_data_free);
+
+ g_object_watch_closure (unique_gimp, closure);
+
+ source = g_idle_source_new ();
+ g_source_set_closure (source, closure);
+ g_source_attach (source, NULL);
+ g_source_unref (source);
+ }
}
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]