gnome-terminal r2916 - trunk/src
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-terminal r2916 - trunk/src
- Date: Wed, 18 Jun 2008 20:25:42 +0000 (UTC)
Author: chpe
Date: Wed Jun 18 20:25:42 2008
New Revision: 2916
URL: http://svn.gnome.org/viewvc/gnome-terminal?rev=2916&view=rev
Log:
Bug 305268 â Add option --maximized
Modified:
trunk/src/terminal-app.c
trunk/src/terminal.c
Modified: trunk/src/terminal-app.c
==============================================================================
--- trunk/src/terminal-app.c (original)
+++ trunk/src/terminal-app.c Wed Jun 18 20:25:42 2008
@@ -1220,7 +1220,9 @@
if (lt == tabs)
{
- g_ptr_array_add (args, g_strdup_printf ("--window-with-profile-internal-id=%s",
+ GdkWindowState state;
+
+ g_ptr_array_add (args, g_strdup_printf ("--window-with-profile-internal-id=%s",
profile_id));
if (terminal_window_get_menubar_visible (window))
g_ptr_array_add (args, g_strdup ("--show-menubar"));
@@ -1229,6 +1231,12 @@
g_ptr_array_add (args, g_strdup_printf ("--role=%s",
gtk_window_get_role (GTK_WINDOW (window))));
+
+ state = gdk_window_get_state (GTK_WIDGET (window)->window);
+ if (state & GDK_WINDOW_STATE_MAXIMIZED)
+ g_ptr_array_add (args, g_strdup ("--maximize"));
+ if (state & GDK_WINDOW_STATE_FULLSCREEN)
+ g_ptr_array_add (args, g_strdup ("--full-screen"));
}
else
{
Modified: trunk/src/terminal.c
==============================================================================
--- trunk/src/terminal.c (original)
+++ trunk/src/terminal.c Wed Jun 18 20:25:42 2008
@@ -82,7 +82,8 @@
GList *initial_windows;
gboolean default_window_menubar_forced;
gboolean default_window_menubar_state;
- gboolean default_start_fullscreen;
+ gboolean default_fullscreen;
+ gboolean default_maximize;
char *default_role;
char *default_geometry;
char *default_working_dir;
@@ -119,6 +120,7 @@
gboolean menubar_state;
gboolean start_fullscreen;
+ gboolean start_maximized;
char *geometry;
char *role;
@@ -204,7 +206,8 @@
results->default_window_menubar_forced = FALSE;
}
- iw->start_fullscreen = results->default_start_fullscreen;
+ iw->start_fullscreen |= results->default_fullscreen;
+ iw->start_maximized |= results->default_maximize;
}
static InitialWindow*
@@ -521,6 +524,26 @@
}
static gboolean
+option_maximize_callback (const gchar *option_name,
+ const gchar *value,
+ gpointer data,
+ GError **error)
+{
+ OptionParsingResults *results = data;
+ InitialWindow *iw;
+
+ if (results->initial_windows)
+ {
+ iw = g_list_last (results->initial_windows)->data;
+ iw->start_maximized = TRUE;
+ }
+ else
+ results->default_maximize = TRUE;
+
+ return TRUE;
+}
+
+static gboolean
option_fullscreen_callback (const gchar *option_name,
const gchar *value,
gpointer data,
@@ -535,7 +558,7 @@
iw->start_fullscreen = TRUE;
}
else
- results->default_start_fullscreen = TRUE;
+ results->default_fullscreen = TRUE;
return TRUE;
}
@@ -708,10 +731,11 @@
results = g_slice_new0 (OptionParsingResults);
- results->default_window_menubar_forced = 0;
- results->default_window_menubar_state = 1;
- results->default_start_fullscreen = 0;
- results->execute = 0;
+ results->default_window_menubar_forced = FALSE;
+ results->default_window_menubar_state = TRUE;
+ results->default_fullscreen = FALSE;
+ results->default_maximize = FALSE;
+ results->execute = FALSE;
results->use_factory = TRUE;
results->startup_id = NULL;
@@ -993,6 +1017,8 @@
if (iw->start_fullscreen)
gtk_window_fullscreen (GTK_WINDOW (window));
+ if (iw->start_maximized)
+ gtk_window_maximize (GTK_WINDOW (window));
/* Now add the tabs */
for (lt = iw->tabs; lt != NULL; lt = lt->next)
@@ -1355,6 +1381,15 @@
NULL
},
{
+ "maximize",
+ 0,
+ G_OPTION_FLAG_NO_ARG,
+ G_OPTION_ARG_CALLBACK,
+ option_maximize_callback,
+ N_("Set the last-specified window into maximized mode; applies to only one window; can be specified once for each window you create from the command line."),
+ NULL
+ },
+ {
"full-screen",
0,
G_OPTION_FLAG_NO_ARG,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]