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).
This commit is contained in:
Sven Neumann
2006-08-14 19:11:15 +00:00
committed by Sven Neumann
parent 682bf81548
commit 179f0cc4f4
3 changed files with 26 additions and 2 deletions

View File

@ -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 ();