[Commits] [SCM] claws branch, master, updated. 3.13.2-48-gd1c40b3

mones at claws-mail.org mones at claws-mail.org
Fri Feb 19 19:18:41 CET 2016


The branch, master has been updated
       via  d1c40b332d9bb908df7694d19a60b2319a2a00fc (commit)
      from  bb974610e7ce07776f00c3eaa6743a6d458ee94d (commit)

Summary of changes:
 doc/man/claws-mail.1 |    6 ++++++
 src/main.c           |   22 ++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit d1c40b332d9bb908df7694d19a60b2319a2a00fc
Author: Ricardo Mones <ricardo at mones.org>
Date:   Fri Feb 19 19:15:12 2016 +0100

    Fix bug #2604: Add support for -geometry
    
    And document it too :-)

diff --git a/doc/man/claws-mail.1 b/doc/man/claws-mail.1
index f16d081..d98d481 100644
--- a/doc/man/claws-mail.1
+++ b/doc/man/claws-mail.1
@@ -142,6 +142,8 @@ This list is not complete.
 \fB \-\-config\-dir\fR
 .br
 \fB \-\-alternate\-config\-dir [dir]\fR
+.br
+\fB \-\-geometry WxH+X+Y\fR
 
 .SH "FILES"
 .LP 
@@ -355,6 +357,8 @@ display the CONFIG\-DIR and exit
 .TP
 \fB\-\-alternate\-config\-dir [dir]\fR
 start Claws Mail with the configuration stored in [dir] directory
+\fB\-\-geometry WxH+X+Y\fR
+set initial X geometry of main window
 
 .SH "ENVIRONMENT"
 .LP
@@ -544,4 +548,6 @@ Claws Mail online manual
 .TP
 Claws Mail plugins
 <http://www.claws\-mail.org/plugins.php>
+.TP
+\fIX\fR(7), \fIxwininfo\fR(1).
 
diff --git a/src/main.c b/src/main.c
index 7506e17..c657e8f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2015 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
  */
 
 #ifdef HAVE_CONFIG_H
@@ -202,6 +201,7 @@ static struct RemoteCmd {
 	const gchar *subscribe_uri;
 	const gchar *target;
 	gboolean debug;
+	const gchar *geometry;
 } cmd;
 
 SessionStats session_stats;
@@ -1466,6 +1466,19 @@ int main(int argc, char *argv[])
 			main_window_popup(mainwin);
 	}
 
+	if (cmd.geometry != NULL) {
+		if (!gtk_window_parse_geometry(GTK_WINDOW(mainwin->window), cmd.geometry))
+			g_warning("failed to parse geometry '%s'", cmd.geometry);
+		else {
+			int width, height;
+
+			if (sscanf(cmd.geometry, "%ux%u+", &width, &height) == 2)
+				gtk_window_resize(GTK_WINDOW(mainwin->window), width, height);
+			else
+				g_warning("failed to parse geometry's width/height");
+		}
+	}
+
 	if (!folder_have_mailbox()) {
 		prefs_destroy_cache();
 		main_window_cursor_normal(mainwin);
@@ -1947,6 +1960,8 @@ static void parse_cmd_opt(int argc, char *argv[])
 			g_print("%s\n", _("  --config-dir           output configuration directory"));
 			g_print("%s\n", _("  --alternate-config-dir [dir]\n"
 			                  "                         use specified configuration directory"));
+			g_print("%s\n", _("  --geometry -geometry WxH+X+Y\n"
+					  "                         set geometry for main window"));
 
 			g_free(base);
 			exit(1);
@@ -1959,6 +1974,9 @@ static void parse_cmd_opt(int argc, char *argv[])
 			exit(0);
 		} else if (!strncmp(argv[i], "--alternate-config-dir", sizeof "--alternate-config-dir" - 1) && i+1 < argc) {
 			set_rc_dir(argv[i+1]);
+		} else if (!strncmp(argv[i], "--geometry", sizeof "--geometry" - 1)
+			  || !strncmp(argv[i], "-geometry", sizeof "-geometry" - 1)) {
+			cmd.geometry = (i+1 < argc)? argv[i+1]: NULL;
 		} else if (!strncmp(argv[i], "--exit", 6) ||
 			   !strncmp(argv[i], "--quit", 6) ||
 			   !strncmp(argv[i], "-q", 2)) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list