Commit 1b76518e authored by John Harper's avatar John Harper Committed by John Harper

reviewed by: Darin Adler <darin@eazel.com>

2000-12-21  John Harper  <jsh@eazel.com>

	reviewed by: Darin Adler  <darin@eazel.com>

	Work to allow geometry of initial window to be specified on
	command line. Fixes bug #5135

	* src/nautilus-shell.c (open_window): new arg `geometry'. When
	non-null, use nautilus_gtk_window_set_initial_geometry_from_string
	to affect the geometry of the unmapped window

	(corba_open_default_window, corba_open_windows): new arg,
	`geometry', passed to open_window () if a non-null string

	* src/nautilus-shell-interface.idl (open_windows,
	open_default_window): added `geometry' parameter. Pass a
	zero-length string to show no specified geometry

	* src/nautilus-main.c (main): new option `--geometry=GEOMETRY'.
	Pass the value to nautilus_application_startup (). This option
	is only allowed when no more than one URI is given on the
	command line (to prevent multiple windows appearing on top of
	one another)

	* src/nautilus-application.c, src/nautilus-application.h
	(nautilus_application_startup): added parameter `geometry', a
	string describing the geometry to give any created windows

	* src/nautilus-first-time-druid.c (druid_finished): pass null
	geometry parameter to nautilus_application_startup ()

	* libnautilus/nautilus-gdk-extensions.c,
	libnautilus/nautilus-gdk-extensions.h
	(NautilusGdkGeometryFlags, nautilus_gdk_parse_geometry): a
	wrapper for XParseGeometry () and associated bit definitions.
	Required since gnome_parse_geometry () offers no reliable way
	of detecting which of the geometry components were parsed
	successfully

	* libnautilus/nautilus-gtk-extensions.c,
	libnautilus/nautilus-gtk-extensions.h
	(nautilus_gtk_window_set_initial_geometry): takes an extra
	parameter, a NautilusGdkGeometryFlags value specifying which of
	the geometry parameters are valid

	(nautilus_gtk_window_set_initial_geometry_from_string): changed
	to allow the geometry string to specify one or both of position
	and dimensions. Also doesn't use g_return_if_fail to test for
	validity of input string (since it may come from the user),
	instead just use the parseable parts of the geometry string
parent 632ba58d
2000-12-21 John Harper <jsh@eazel.com>
reviewed by: Darin Adler <darin@eazel.com>
Work to allow geometry of initial window to be specified on
command line. Fixes bug #5135
* src/nautilus-shell.c (open_window): new arg `geometry'. When
non-null, use nautilus_gtk_window_set_initial_geometry_from_string
to affect the geometry of the unmapped window
(corba_open_default_window, corba_open_windows): new arg,
`geometry', passed to open_window () if a non-null string
* src/nautilus-shell-interface.idl (open_windows,
open_default_window): added `geometry' parameter. Pass a
zero-length string to show no specified geometry
* src/nautilus-main.c (main): new option `--geometry=GEOMETRY'.
Pass the value to nautilus_application_startup (). This option
is only allowed when no more than one URI is given on the
command line (to prevent multiple windows appearing on top of
one another)
* src/nautilus-application.c, src/nautilus-application.h
(nautilus_application_startup): added parameter `geometry', a
string describing the geometry to give any created windows
* src/nautilus-first-time-druid.c (druid_finished): pass null
geometry parameter to nautilus_application_startup ()
* libnautilus/nautilus-gdk-extensions.c,
libnautilus/nautilus-gdk-extensions.h
(NautilusGdkGeometryFlags, nautilus_gdk_parse_geometry): a
wrapper for XParseGeometry () and associated bit definitions.
Required since gnome_parse_geometry () offers no reliable way
of detecting which of the geometry components were parsed
successfully
* libnautilus/nautilus-gtk-extensions.c,
libnautilus/nautilus-gtk-extensions.h
(nautilus_gtk_window_set_initial_geometry): takes an extra
parameter, a NautilusGdkGeometryFlags value specifying which of
the geometry parameters are valid
(nautilus_gtk_window_set_initial_geometry_from_string): changed
to allow the geometry string to specify one or both of position
and dimensions. Also doesn't use g_return_if_fail to test for
validity of input string (since it may come from the user),
instead just use the parseable parts of the geometry string
2000-12-22 John Sullivan <sullivan@eazel.com>
reviewed by: Pavel Cisler <pavel@eazel.com>
......
......@@ -1071,4 +1071,46 @@ nautilus_self_check_gdk_extensions (void)
gdk_font_unref (font);
}
NautilusGdkGeometryFlags
nautilus_gdk_parse_geometry (const char *string, int *x_return, int *y_return,
guint *width_return, guint *height_return)
{
int x11_flags;
NautilusGdkGeometryFlags gdk_flags;
g_return_val_if_fail (string != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (x_return != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (y_return != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (width_return != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (height_return != NULL, NAUTILUS_GDK_NO_VALUE);
x11_flags = XParseGeometry (string, x_return, y_return,
width_return, height_return);
gdk_flags = NAUTILUS_GDK_NO_VALUE;
if (x11_flags & NoValue) {
gdk_flags |= NAUTILUS_GDK_NO_VALUE;
}
if (x11_flags & XValue) {
gdk_flags |= NAUTILUS_GDK_X_VALUE;
}
if (x11_flags & YValue) {
gdk_flags |= NAUTILUS_GDK_Y_VALUE;
}
if (x11_flags & WidthValue) {
gdk_flags |= NAUTILUS_GDK_WIDTH_VALUE;
}
if (x11_flags & HeightValue) {
gdk_flags |= NAUTILUS_GDK_HEIGHT_VALUE;
}
if (x11_flags & XNegative) {
gdk_flags |= NAUTILUS_GDK_X_NEGATIVE;
}
if (x11_flags & YNegative) {
gdk_flags |= NAUTILUS_GDK_Y_NEGATIVE;
}
return gdk_flags;
}
#endif /* ! NAUTILUS_OMIT_SELF_CHECK */
......@@ -53,6 +53,18 @@
#define NAUTILUS_RGBA_COLOR_GET_B(color) (((color) >> 0) & 0xff)
#define NAUTILUS_RGBA_COLOR_GET_A(color) (((color) >> 24) & 0xff)
/* Bits returned by nautilus_gdk_parse_geometry */
typedef enum {
NAUTILUS_GDK_NO_VALUE = 0x00,
NAUTILUS_GDK_X_VALUE = 0x01,
NAUTILUS_GDK_Y_VALUE = 0x02,
NAUTILUS_GDK_WIDTH_VALUE = 0x04,
NAUTILUS_GDK_HEIGHT_VALUE = 0x08,
NAUTILUS_GDK_ALL_VALUES = 0x0f,
NAUTILUS_GDK_X_NEGATIVE = 0x10,
NAUTILUS_GDK_Y_NEGATIVE = 0x20,
} NautilusGdkGeometryFlags;
/* A gradient spec. is a string that contains a specifier for either a
color or a gradient. If the string has a "-" in it, then it's a gradient.
The gradient is vertical by default and the spec. can end with ":v" to indicate that.
......@@ -153,5 +165,12 @@ void nautilus_gdk_window_set_wm_hints_input (GdkWindow *w,
char * nautilus_string_ellipsize_start (const char *original,
GdkFont *font,
int length);
/* Wrapper for XParseGeometry */
NautilusGdkGeometryFlags nautilus_gdk_parse_geometry (const char *string,
int *x_return,
int *y_return,
guint *width_return,
guint *height_return);
#endif /* NAUTILUS_GDK_EXTENSIONS_H */
......@@ -359,21 +359,11 @@ nautilus_gtk_window_set_up_close_accelerator (GtkWindow *window)
}
static void
sanity_check_window_geometry (int *left, int *top, int *width, int *height)
sanity_check_window_position (int *left, int *top)
{
g_assert (left != NULL);
g_assert (top != NULL);
g_assert (width != NULL);
g_assert (height != NULL);
/* Pin the size of the window to the screen, so we don't end up in
* a state where the window is so big essential parts of it can't
* be reached (might not be necessary with all window managers,
* but seems reasonable anyway).
*/
*width = MIN (*width, gdk_screen_width());
*height = MIN (*height, gdk_screen_height());
/* Make sure the top of the window is on screen, for
* draggability (might not be necessary with all window managers,
* but seems reasonable anyway). Make sure the top of the window
......@@ -396,6 +386,20 @@ sanity_check_window_geometry (int *left, int *top, int *width, int *height)
*left = CLAMP (*left, 0, gdk_screen_width() - MINIMUM_ON_SCREEN_WIDTH);
}
static void
sanity_check_window_dimensions (int *width, int *height)
{
g_assert (width != NULL);
g_assert (height != NULL);
/* Pin the size of the window to the screen, so we don't end up in
* a state where the window is so big essential parts of it can't
* be reached (might not be necessary with all window managers,
* but seems reasonable anyway).
*/
*width = MIN (*width, gdk_screen_width());
*height = MIN (*height, gdk_screen_height());
}
/**
* nautilus_gtk_window_set_initial_geometry:
......@@ -406,6 +410,8 @@ sanity_check_window_geometry (int *left, int *top, int *width, int *height)
* some sanity-checking on the passed-in values.
*
* @window: A non-visible GtkWindow
* @geometry_flags: A NautilusGdkGeometryFlags value defining which of
* the following parameters have defined values
* @left: pixel coordinate for left of window
* @top: pixel coordinate for top of window
* @width: width of window in pixels
......@@ -413,13 +419,17 @@ sanity_check_window_geometry (int *left, int *top, int *width, int *height)
*/
void
nautilus_gtk_window_set_initial_geometry (GtkWindow *window,
NautilusGdkGeometryFlags geometry_flags,
int left,
int top,
int width,
int height)
guint width,
guint height)
{
int real_left, real_top;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (width > 0 && height > 0);
g_return_if_fail (!(geometry_flags & NAUTILUS_GDK_WIDTH_VALUE) || width > 0);
g_return_if_fail (!(geometry_flags & NAUTILUS_GDK_HEIGHT_VALUE) || height > 0);
/* Setting the default size doesn't work when the window is already showing.
* Someday we could make this move an already-showing window, but we don't
......@@ -427,10 +437,31 @@ nautilus_gtk_window_set_initial_geometry (GtkWindow *window,
*/
g_return_if_fail (!GTK_WIDGET_VISIBLE (window));
sanity_check_window_geometry (&left, &top, &width, &height);
gtk_widget_set_uposition (GTK_WIDGET (window), left, top);
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
if ((geometry_flags & NAUTILUS_GDK_X_VALUE) && (geometry_flags & NAUTILUS_GDK_Y_VALUE)) {
real_left = left;
real_top = top;
/* This is sub-optimal. GDK doesn't allow us to set win_gravity
* to South/East types, which should be done if using negative
* positions (so that the right or bottom edge of the window
* appears at the specified position, not the left or top).
* However it does seem to be consistent with other GNOME apps.
*/
if (geometry_flags & NAUTILUS_GDK_X_NEGATIVE) {
real_left = gdk_screen_width () - real_left;
}
if (geometry_flags & NAUTILUS_GDK_Y_NEGATIVE) {
real_top = gdk_screen_height () - real_top;
}
sanity_check_window_position (&real_left, &real_top);
gtk_widget_set_uposition (GTK_WIDGET (window), real_left, real_top);
}
if ((geometry_flags & NAUTILUS_GDK_WIDTH_VALUE) && (geometry_flags & NAUTILUS_GDK_HEIGHT_VALUE)) {
sanity_check_window_dimensions (&width, &height);
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
}
}
/**
......@@ -455,8 +486,9 @@ nautilus_gtk_window_set_initial_geometry_from_string (GtkWindow *window,
guint minimum_width,
guint minimum_height)
{
int left, top, width, height;
gboolean parsed;
int left, top;
guint width, height;
NautilusGdkGeometryFlags geometry_flags;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (geometry_string != NULL);
......@@ -467,18 +499,19 @@ nautilus_gtk_window_set_initial_geometry_from_string (GtkWindow *window,
*/
g_return_if_fail (!GTK_WIDGET_VISIBLE (window));
parsed = gnome_parse_geometry (geometry_string, &left, &top, &width, &height);
/* Bogus string, dude. */
g_return_if_fail (parsed);
geometry_flags = nautilus_gdk_parse_geometry (geometry_string, &left, &top, &width, &height);
/* Make sure the window isn't smaller than makes sense for this window.
* Other sanity checks are performed in set_initial_geometry.
*/
width = MAX (width, (int) minimum_width);
height = MAX (height, (int) minimum_height);
if (geometry_flags & NAUTILUS_GDK_WIDTH_VALUE) {
width = MAX (width, minimum_width);
}
if (geometry_flags & NAUTILUS_GDK_HEIGHT_VALUE) {
height = MAX (height, minimum_height);
}
nautilus_gtk_window_set_initial_geometry (window, left, top, width, height);
nautilus_gtk_window_set_initial_geometry (window, geometry_flags, left, top, width, height);
}
/**
......
......@@ -33,6 +33,7 @@
#include <gtk/gtkmenuitem.h>
#include <gtk/gtkpixmap.h>
#include <gtk/gtkwindow.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#define NAUTILUS_DEFAULT_POPUP_MENU_DISPLACEMENT 2
#define NAUTILUS_STANDARD_CLOSE_WINDOW_CONTROL_KEY 'w'
......@@ -100,10 +101,11 @@ void nautilus_gtk_container_foreach_deep (GtkContainer *contain
/* GtkWindow */
void nautilus_gtk_window_set_initial_geometry (GtkWindow *window,
NautilusGdkGeometryFlags geometry_flags,
int left,
int top,
int width,
int height);
guint width,
guint height);
void nautilus_gtk_window_set_initial_geometry_from_string
(GtkWindow *window,
const char *geometry_string,
......
......@@ -1071,4 +1071,46 @@ nautilus_self_check_gdk_extensions (void)
gdk_font_unref (font);
}
NautilusGdkGeometryFlags
nautilus_gdk_parse_geometry (const char *string, int *x_return, int *y_return,
guint *width_return, guint *height_return)
{
int x11_flags;
NautilusGdkGeometryFlags gdk_flags;
g_return_val_if_fail (string != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (x_return != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (y_return != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (width_return != NULL, NAUTILUS_GDK_NO_VALUE);
g_return_val_if_fail (height_return != NULL, NAUTILUS_GDK_NO_VALUE);
x11_flags = XParseGeometry (string, x_return, y_return,
width_return, height_return);
gdk_flags = NAUTILUS_GDK_NO_VALUE;
if (x11_flags & NoValue) {
gdk_flags |= NAUTILUS_GDK_NO_VALUE;
}
if (x11_flags & XValue) {
gdk_flags |= NAUTILUS_GDK_X_VALUE;
}
if (x11_flags & YValue) {
gdk_flags |= NAUTILUS_GDK_Y_VALUE;
}
if (x11_flags & WidthValue) {
gdk_flags |= NAUTILUS_GDK_WIDTH_VALUE;
}
if (x11_flags & HeightValue) {
gdk_flags |= NAUTILUS_GDK_HEIGHT_VALUE;
}
if (x11_flags & XNegative) {
gdk_flags |= NAUTILUS_GDK_X_NEGATIVE;
}
if (x11_flags & YNegative) {
gdk_flags |= NAUTILUS_GDK_Y_NEGATIVE;
}
return gdk_flags;
}
#endif /* ! NAUTILUS_OMIT_SELF_CHECK */
......@@ -53,6 +53,18 @@
#define NAUTILUS_RGBA_COLOR_GET_B(color) (((color) >> 0) & 0xff)
#define NAUTILUS_RGBA_COLOR_GET_A(color) (((color) >> 24) & 0xff)
/* Bits returned by nautilus_gdk_parse_geometry */
typedef enum {
NAUTILUS_GDK_NO_VALUE = 0x00,
NAUTILUS_GDK_X_VALUE = 0x01,
NAUTILUS_GDK_Y_VALUE = 0x02,
NAUTILUS_GDK_WIDTH_VALUE = 0x04,
NAUTILUS_GDK_HEIGHT_VALUE = 0x08,
NAUTILUS_GDK_ALL_VALUES = 0x0f,
NAUTILUS_GDK_X_NEGATIVE = 0x10,
NAUTILUS_GDK_Y_NEGATIVE = 0x20,
} NautilusGdkGeometryFlags;
/* A gradient spec. is a string that contains a specifier for either a
color or a gradient. If the string has a "-" in it, then it's a gradient.
The gradient is vertical by default and the spec. can end with ":v" to indicate that.
......@@ -153,5 +165,12 @@ void nautilus_gdk_window_set_wm_hints_input (GdkWindow *w,
char * nautilus_string_ellipsize_start (const char *original,
GdkFont *font,
int length);
/* Wrapper for XParseGeometry */
NautilusGdkGeometryFlags nautilus_gdk_parse_geometry (const char *string,
int *x_return,
int *y_return,
guint *width_return,
guint *height_return);
#endif /* NAUTILUS_GDK_EXTENSIONS_H */
......@@ -359,21 +359,11 @@ nautilus_gtk_window_set_up_close_accelerator (GtkWindow *window)
}
static void
sanity_check_window_geometry (int *left, int *top, int *width, int *height)
sanity_check_window_position (int *left, int *top)
{
g_assert (left != NULL);
g_assert (top != NULL);
g_assert (width != NULL);
g_assert (height != NULL);
/* Pin the size of the window to the screen, so we don't end up in
* a state where the window is so big essential parts of it can't
* be reached (might not be necessary with all window managers,
* but seems reasonable anyway).
*/
*width = MIN (*width, gdk_screen_width());
*height = MIN (*height, gdk_screen_height());
/* Make sure the top of the window is on screen, for
* draggability (might not be necessary with all window managers,
* but seems reasonable anyway). Make sure the top of the window
......@@ -396,6 +386,20 @@ sanity_check_window_geometry (int *left, int *top, int *width, int *height)
*left = CLAMP (*left, 0, gdk_screen_width() - MINIMUM_ON_SCREEN_WIDTH);
}
static void
sanity_check_window_dimensions (int *width, int *height)
{
g_assert (width != NULL);
g_assert (height != NULL);
/* Pin the size of the window to the screen, so we don't end up in
* a state where the window is so big essential parts of it can't
* be reached (might not be necessary with all window managers,
* but seems reasonable anyway).
*/
*width = MIN (*width, gdk_screen_width());
*height = MIN (*height, gdk_screen_height());
}
/**
* nautilus_gtk_window_set_initial_geometry:
......@@ -406,6 +410,8 @@ sanity_check_window_geometry (int *left, int *top, int *width, int *height)
* some sanity-checking on the passed-in values.
*
* @window: A non-visible GtkWindow
* @geometry_flags: A NautilusGdkGeometryFlags value defining which of
* the following parameters have defined values
* @left: pixel coordinate for left of window
* @top: pixel coordinate for top of window
* @width: width of window in pixels
......@@ -413,13 +419,17 @@ sanity_check_window_geometry (int *left, int *top, int *width, int *height)
*/
void
nautilus_gtk_window_set_initial_geometry (GtkWindow *window,
NautilusGdkGeometryFlags geometry_flags,
int left,
int top,
int width,
int height)
guint width,
guint height)
{
int real_left, real_top;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (width > 0 && height > 0);
g_return_if_fail (!(geometry_flags & NAUTILUS_GDK_WIDTH_VALUE) || width > 0);
g_return_if_fail (!(geometry_flags & NAUTILUS_GDK_HEIGHT_VALUE) || height > 0);
/* Setting the default size doesn't work when the window is already showing.
* Someday we could make this move an already-showing window, but we don't
......@@ -427,10 +437,31 @@ nautilus_gtk_window_set_initial_geometry (GtkWindow *window,
*/
g_return_if_fail (!GTK_WIDGET_VISIBLE (window));
sanity_check_window_geometry (&left, &top, &width, &height);
gtk_widget_set_uposition (GTK_WIDGET (window), left, top);
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
if ((geometry_flags & NAUTILUS_GDK_X_VALUE) && (geometry_flags & NAUTILUS_GDK_Y_VALUE)) {
real_left = left;
real_top = top;
/* This is sub-optimal. GDK doesn't allow us to set win_gravity
* to South/East types, which should be done if using negative
* positions (so that the right or bottom edge of the window
* appears at the specified position, not the left or top).
* However it does seem to be consistent with other GNOME apps.
*/
if (geometry_flags & NAUTILUS_GDK_X_NEGATIVE) {
real_left = gdk_screen_width () - real_left;
}
if (geometry_flags & NAUTILUS_GDK_Y_NEGATIVE) {
real_top = gdk_screen_height () - real_top;
}
sanity_check_window_position (&real_left, &real_top);
gtk_widget_set_uposition (GTK_WIDGET (window), real_left, real_top);
}
if ((geometry_flags & NAUTILUS_GDK_WIDTH_VALUE) && (geometry_flags & NAUTILUS_GDK_HEIGHT_VALUE)) {
sanity_check_window_dimensions (&width, &height);
gtk_window_set_default_size (GTK_WINDOW (window), width, height);
}
}
/**
......@@ -455,8 +486,9 @@ nautilus_gtk_window_set_initial_geometry_from_string (GtkWindow *window,
guint minimum_width,
guint minimum_height)
{
int left, top, width, height;
gboolean parsed;
int left, top;
guint width, height;
NautilusGdkGeometryFlags geometry_flags;
g_return_if_fail (GTK_IS_WINDOW (window));
g_return_if_fail (geometry_string != NULL);
......@@ -467,18 +499,19 @@ nautilus_gtk_window_set_initial_geometry_from_string (GtkWindow *window,
*/
g_return_if_fail (!GTK_WIDGET_VISIBLE (window));
parsed = gnome_parse_geometry (geometry_string, &left, &top, &width, &height);
/* Bogus string, dude. */
g_return_if_fail (parsed);
geometry_flags = nautilus_gdk_parse_geometry (geometry_string, &left, &top, &width, &height);
/* Make sure the window isn't smaller than makes sense for this window.
* Other sanity checks are performed in set_initial_geometry.
*/
width = MAX (width, (int) minimum_width);
height = MAX (height, (int) minimum_height);
if (geometry_flags & NAUTILUS_GDK_WIDTH_VALUE) {
width = MAX (width, minimum_width);
}
if (geometry_flags & NAUTILUS_GDK_HEIGHT_VALUE) {
height = MAX (height, minimum_height);
}
nautilus_gtk_window_set_initial_geometry (window, left, top, width, height);
nautilus_gtk_window_set_initial_geometry (window, geometry_flags, left, top, width, height);
}
/**
......
......@@ -33,6 +33,7 @@
#include <gtk/gtkmenuitem.h>
#include <gtk/gtkpixmap.h>
#include <gtk/gtkwindow.h>
#include <libnautilus-extensions/nautilus-gdk-extensions.h>
#define NAUTILUS_DEFAULT_POPUP_MENU_DISPLACEMENT 2
#define NAUTILUS_STANDARD_CLOSE_WINDOW_CONTROL_KEY 'w'
......@@ -100,10 +101,11 @@ void nautilus_gtk_container_foreach_deep (GtkContainer *contain
/* GtkWindow */
void nautilus_gtk_window_set_initial_geometry (GtkWindow *window,
NautilusGdkGeometryFlags geometry_flags,
int left,
int top,
int width,
int height);
guint width,
guint height);
void nautilus_gtk_window_set_initial_geometry_from_string
(GtkWindow *window,
const char *geometry_string,
......
......@@ -311,6 +311,7 @@ nautilus_application_startup (NautilusApplication *application,
gboolean restart_shell,
gboolean start_desktop,
gboolean no_default_window,
const char *geometry,
const char *urls[])
{
CORBA_Environment ev;
......@@ -319,6 +320,7 @@ nautilus_application_startup (NautilusApplication *application,
const char *message, *detailed_message;
GnomeDialog *dialog;
Nautilus_URIList *url_list;
const CORBA_char *corba_geometry;
/* Perform check for nautilus being run as super user */
if (!check_for_and_run_as_super_user ()) {
......@@ -438,13 +440,17 @@ nautilus_application_startup (NautilusApplication *application,
Nautilus_Shell_start_desktop (shell, &ev);
}
/* CORBA C mapping doesn't allow NULL to be passed
for string parameters */
corba_geometry = (geometry != NULL) ? geometry : "";
/* Create the other windows. */
if (urls != NULL) {
url_list = nautilus_make_uri_list_from_strv (urls);
Nautilus_Shell_open_windows (shell, url_list, &ev);
Nautilus_Shell_open_windows (shell, url_list, corba_geometry, &ev);
CORBA_free (url_list);
} else if (!no_default_window) {
Nautilus_Shell_open_default_window (shell, &ev);
Nautilus_Shell_open_default_window (shell, corba_geometry, &ev);
}
}
......
......@@ -59,6 +59,7 @@ void nautilus_application_startup (NautilusApplication *ap
gboolean restart_shell,
gboolean start_desktop,
gboolean no_default_window,
const char *default_geometry,
const char *urls[]);
GSList *nautilus_application_windows (void);
......
......@@ -221,7 +221,7 @@ druid_finished (GtkWidget *druid_page)
signup_uris[1] = NULL;
nautilus_application_startup (save_application, FALSE, FALSE, save_manage_desktop,
FALSE, (signup_uris[0] != NULL) ? signup_uris : NULL);
FALSE, NULL, (signup_uris[0] != NULL) ? signup_uris : NULL);
/* Destroy druid last because it may be the only thing keeping the main event loop alive. */
gtk_widget_destroy (gtk_widget_get_toplevel (druid_page));
......