Commit 179f0cc4 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

tools/gimp-remote.c applied patch from Michael Klein that adds an option

2006-08-14  Sven Neumann  <sven@gimp.org>

	* tools/gimp-remote.c
	* docs/gimp-remote.1.in: applied patch from Michael Klein that
adds
	an option to print out the XID of the toolbox window (bug
#351205).
parent 682bf815
2006-08-14 Sven Neumann <sven@gimp.org>
* tools/gimp-remote.c
* docs/gimp-remote.1.in: applied patch from Michael Klein that adds
an option to print out the XID of the toolbox window (bug #351205).
2006-08-14 Sven Neumann <sven@gimp.org>
* plug-ins/winicon/icoload.c: open the file in binary mode.
......
......@@ -6,6 +6,7 @@ gimp\-remote - tells a running GIMP to open a (local or remote) image file.
.B gimp-remote
[\-h] [\-\-help] [-v] [\-\-version] [\-\-display \fIdisplay\fP]
[\-e] [\-\-existing] [\-q] [\-\-query] [\-s] [\-\-no\-splash]
[\-p] [\-\-print\-xid]
\fIfilename\fP ...
......@@ -45,6 +46,10 @@ If no running GIMP instance is found, don't start a new one but exit.
Check if GIMP is running and exit. A status code of 0 indicates that
a GIMP toolbox window has been found on this display.
.TP 8
.B \-p, \-\-print-xid
Like \-q, but print the X Window ID of the toolbox window if GIMP is already
running. If no such window exists nothing is printed.
.TP 8
.B \-s, \-\-no\-splash
When starting GIMP, do not show the splash screen.
......
......@@ -69,6 +69,7 @@ static void show_version (void) G_GNUC_NORETURN;
static gboolean existing = FALSE;
static gboolean query = FALSE;
static gboolean no_splash = FALSE;
static gboolean print_xid = FALSE;
static const gchar **filenames = NULL;
static const GOptionEntry main_entries[] =
......@@ -87,6 +88,11 @@ static const GOptionEntry main_entries[] =
G_OPTION_ARG_NONE, &query,
N_("Only check if GIMP is running, then quit"), NULL
},
{
"print-xid", 'p', 0,
G_OPTION_ARG_NONE, &print_xid,
N_("Print X window ID of GIMP toolbox window, then quit"), NULL
},
{
"no-splash", 's', 0,
G_OPTION_ARG_NONE, &no_splash,
......@@ -449,14 +455,14 @@ main (gint argc,
screen = gdk_screen_get_default ();
/* if called without any filenames, always start a new GIMP */
if (file_list->len == 0 && !query && !existing)
if (file_list->len == 0 && !query && !print_xid && !existing)
{
start_new_gimp (screen, argv[0], desktop_startup_id, file_list);
}
gimp_window = gimp_remote_find_window (display, screen);
if (! query)
if (! query && ! print_xid)
{
if (gimp_window)
{
......@@ -524,6 +530,13 @@ main (gint argc,
start_new_gimp (screen, argv[0], desktop_startup_id, file_list);
}
}
else if (print_xid)
{
if (gimp_window)
{
g_print ("0x%lx\n", GDK_WINDOW_XID (gimp_window));
}
}
gdk_notify_startup_complete ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment