diff -ur gnome-terminal-2.10.0/src/gnome-terminal.schemas.in gnome-terminal-2.10.0-with-geometry/src/gnome-terminal.schemas.in
--- gnome-terminal-2.10.0/src/gnome-terminal.schemas.in 2004-08-18 00:41:35.000000000 +1000
+++ gnome-terminal-2.10.0-with-geometry/src/gnome-terminal.schemas.in 2005-09-15 12:16:09.923776840 +1000
@@ -628,6 +628,21 @@
+
+ /schemas/apps/gnome-terminal/profiles/Default/geometry
+ /apps/gnome-terminal/profiles/Default/geometry
+ gnome-terminal
+ string
+ true
+
+ Default geometry for terminal
+
+ Set the width/height of the terminal on startup.
+
+
+
+
+
diff -ur gnome-terminal-2.10.0/src/terminal.c gnome-terminal-2.10.0-with-geometry/src/terminal.c
--- gnome-terminal-2.10.0/src/terminal.c 2005-03-03 11:18:35.000000000 +1100
+++ gnome-terminal-2.10.0-with-geometry/src/terminal.c 2005-09-15 13:24:39.054094080 +1000
@@ -1959,13 +1959,12 @@
terminal_window_set_active (window, screen);
- if (geometry)
- {
- if (!gtk_window_parse_geometry (GTK_WINDOW (window),
- geometry))
- g_printerr (_("Invalid geometry string \"%s\"\n"),
- geometry);
- }
+ if (geometry == NULL)
+ geometry = terminal_profile_get_geometry(profile);
+ if (!gtk_window_parse_geometry (GTK_WINDOW (window),
+ geometry))
+ g_printerr (_("Invalid geometry string \"%s\"\n"),
+ geometry);
if (start_fullscreen)
{
diff -ur gnome-terminal-2.10.0/src/terminal-profile.c gnome-terminal-2.10.0-with-geometry/src/terminal-profile.c
--- gnome-terminal-2.10.0/src/terminal-profile.c 2005-03-04 01:13:07.000000000 +1100
+++ gnome-terminal-2.10.0-with-geometry/src/terminal-profile.c 2005-09-15 13:07:00.268054024 +1000
@@ -70,6 +70,7 @@
#define KEY_USE_SYSTEM_FONT "use_system_font"
#define KEY_USE_SKEY "use_skey"
#define KEY_FONT "font"
+#define KEY_GEOMETRY "geometry"
struct _TerminalProfilePrivate
{
@@ -130,6 +131,7 @@
guint use_system_font : 1;
guint use_skey : 1;
guint forgotten : 1;
+ char *geometry;
};
static gboolean
@@ -292,6 +294,7 @@
profile->priv->use_theme_colors = TRUE;
profile->priv->use_system_font = TRUE;
profile->priv->use_skey = TRUE;
+ profile->priv->geometry = g_strdup("80x24");
profile->priv->font = pango_font_description_new ();
pango_font_description_set_family (profile->priv->font,
"monospace");
@@ -1443,7 +1446,7 @@
terminal_profile_get_use_skey (TerminalProfile *profile)
{
g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
-
+
return profile->priv->use_skey;
}
@@ -1466,6 +1469,33 @@
g_free (key);
}
+const char*
+terminal_profile_get_geometry (TerminalProfile *profile)
+{
+ g_return_val_if_fail (TERMINAL_IS_PROFILE (profile), FALSE);
+
+ return profile->priv->geometry;
+}
+
+void
+terminal_profile_set_geometry (TerminalProfile *profile,
+ const char *setting)
+{
+ char *key;
+
+ RETURN_IF_NOTIFYING (profile);
+
+ key = gconf_concat_dir_and_key (profile->priv->profile_dir,
+ KEY_GEOMETRY);
+
+ gconf_client_set_string (profile->priv->conf,
+ key,
+ setting,
+ NULL);
+
+ g_free (key);
+}
+
const PangoFontDescription*
terminal_profile_get_font (TerminalProfile *profile)
@@ -1884,6 +1914,25 @@
}
}
+static gboolean
+set_geometry (TerminalProfile *profile,
+ const char *candidate_geometry)
+{
+ if (candidate_geometry &&
+ strcmp (profile->priv->geometry, candidate_geometry) == 0)
+ return FALSE;
+
+ if (candidate_geometry != NULL)
+ {
+ g_free (profile->priv->geometry);
+ profile->priv->geometry = g_strdup (candidate_geometry);
+ return TRUE;
+ }
+ /* otherwise just leave the old geometry */
+
+ return TRUE;
+}
+
void
terminal_profile_update (TerminalProfile *profile)
{
@@ -1983,6 +2032,7 @@
UPDATE_BOOLEAN (KEY_USE_THEME_COLORS, use_theme_colors);
UPDATE_BOOLEAN (KEY_USE_SYSTEM_FONT, use_system_font);
UPDATE_STRING (KEY_FONT, font);
+ UPDATE_STRING (KEY_GEOMETRY, geometry);
#undef UPDATE_BOOLEAN
#undef UPDATE_INTEGER
@@ -2129,6 +2179,7 @@
UPDATE_BOOLEAN (KEY_USE_THEME_COLORS, use_theme_colors, TRUE);
UPDATE_BOOLEAN (KEY_USE_SYSTEM_FONT, use_system_font, TRUE);
UPDATE_STRING (KEY_FONT, font, NULL);
+ UPDATE_STRING (KEY_GEOMETRY, geometry, NULL);
}
#undef UPDATE_BOOLEAN
@@ -2872,7 +2923,16 @@
BAIL_OUT_CHECK ();
+ g_free (key);
+ key = gconf_concat_dir_and_key (profile_dir,
+ KEY_GEOMETRY);
+ gconf_client_set_string (base_profile->priv->conf,
+ key, base_profile->priv->geometry,
+ &err);
+ g_free (s);
+ BAIL_OUT_CHECK ();
+
/* Add new profile to the profile list; the method for doing this has
* a race condition where we and someone else set at the same time,
* but I am just going to punt on this issue.
diff -ur gnome-terminal-2.10.0/src/terminal-profile.h gnome-terminal-2.10.0-with-geometry/src/terminal-profile.h
--- gnome-terminal-2.10.0/src/terminal-profile.h 2005-03-04 01:13:07.000000000 +1100
+++ gnome-terminal-2.10.0-with-geometry/src/terminal-profile.h 2005-09-15 13:02:50.176073784 +1000
@@ -66,6 +66,7 @@
unsigned int use_theme_colors : 1;
unsigned int use_system_font : 1;
unsigned int font : 1;
+ unsigned int geometry : 1;
} TerminalSettingMask;
typedef enum
@@ -185,6 +186,7 @@
gboolean terminal_profile_get_use_theme_colors (TerminalProfile *profile);
gboolean terminal_profile_get_use_system_font (TerminalProfile *profile);
gboolean terminal_profile_get_use_skey (TerminalProfile *profile);
+const char * terminal_profile_get_geometry (TerminalProfile *profile);
const PangoFontDescription* terminal_profile_get_font (TerminalProfile *profile);
void terminal_profile_set_cursor_blink (TerminalProfile *profile,
@@ -260,6 +262,8 @@
void terminal_profile_set_use_skey (TerminalProfile *profile,
gboolean setting);
+void terminal_profile_set_geometry (TerminalProfile *profile,
+ const char * setting);
void terminal_profile_set_font (TerminalProfile *profile,
const PangoFontDescription *font_desc);
diff -ur gnome-terminal-2.10.0/src/terminal-screen.c gnome-terminal-2.10.0-with-geometry/src/terminal-screen.c
--- gnome-terminal-2.10.0/src/terminal-screen.c 2005-03-04 01:13:08.000000000 +1100
+++ gnome-terminal-2.10.0-with-geometry/src/terminal-screen.c 2005-09-15 13:41:03.944368000 +1000
@@ -503,6 +503,13 @@
terminal_screen_cook_title (screen);
terminal_screen_cook_icon_title (screen);
+ if (terminal_profile_get_geometry (screen->priv->profile)) {
+ int width, height;
+ sscanf(terminal_profile_get_geometry (screen->priv->profile),
+ "%dx%d", &width, &height);
+ terminal_widget_set_size(term, width, height);
+ }
+
if (screen->priv->window)
{
/* We need these in line for the set_size in
@@ -573,6 +580,7 @@
terminal_widget_set_delete_binding (term,
terminal_profile_get_delete_binding (profile));
+
}
/**