diff options
author | Daniel Carl <danielcarl@gmx.de> | 2019-03-12 17:15:07 +0100 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2019-03-12 17:30:35 +0100 |
commit | b8714197a547149d5e23365bd5e79c53f7e94642 (patch) | |
tree | 5fde96015bfa8e8115b8864c8f785e91d4805b08 | |
parent | a884a815658a9acc35549a9d8f750a49778c5eef (diff) |
Allow to not maximize window via option --no-maximize #483.
-rw-r--r-- | doc/vimb.1 | 3 | ||||
-rw-r--r-- | src/main.c | 13 | ||||
-rw-r--r-- | src/main.h | 1 |
3 files changed, 14 insertions, 3 deletions
@@ -48,6 +48,9 @@ Configuration data for the profile is stored in a directory named .B "\-v, \-\-version" Print build and version information and then quit. .TP +.B "\-\-no-maximize" +Do no attempt to maximize window. +.TP .B "\-\-bug-info" Prints information about used libraries for bug reports and then quit. .SH MODES @@ -804,7 +804,9 @@ static GtkWidget *create_window(Client *c) window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_role(GTK_WINDOW(window), PROJECT_UCFIRST); gtk_window_set_default_size(GTK_WINDOW(window), WIN_WIDTH, WIN_HEIGHT); - gtk_window_maximize(GTK_WINDOW(window)); + if (!vb.no_maximize) { + gtk_window_maximize(GTK_WINDOW(window)); + } } g_object_connect( @@ -985,7 +987,8 @@ static void spawn_new_instance(const char *uri) #ifndef FEATURE_NO_XEMBED + (vb.embed ? 2 : 0) #endif - + (vb.profile ? 2 : 0), + + (vb.profile ? 2 : 0) + + (vb.no_maximize ? 1 : 0), sizeof(char *) ); @@ -1007,6 +1010,9 @@ static void spawn_new_instance(const char *uri) cmd[i++] = "-p"; cmd[i++] = vb.profile; } + if (vb.no_maximize) { + cmd[i++] = "--no-maximize"; + } cmd[i++] = (char*)uri; cmd[i++] = NULL; @@ -1933,10 +1939,11 @@ int main(int argc, char* argv[]) gboolean ver = FALSE, buginfo = FALSE; GOptionEntry opts[] = { - {"embed", 'e', 0, G_OPTION_ARG_STRING, &winid, "Reparents to window specified by xid", NULL}, {"config", 'c', 0, G_OPTION_ARG_FILENAME, &vb.configfile, "Custom configuration file", NULL}, + {"embed", 'e', 0, G_OPTION_ARG_STRING, &winid, "Reparents to window specified by xid", NULL}, {"profile", 'p', 0, G_OPTION_ARG_CALLBACK, (GOptionArgFunc*)profileOptionArgFunc, "Profile name", NULL}, {"version", 'v', 0, G_OPTION_ARG_NONE, &ver, "Print version", NULL}, + {"no-maximize", 0, 0, G_OPTION_ARG_NONE, &vb.no_maximize, "Do no attempt to maximize window", NULL}, {"bug-info", 0, 0, G_OPTION_ARG_NONE, &buginfo, "Print used library versions", NULL}, {NULL} }; @@ -267,6 +267,7 @@ struct Vimb { guint closed_max; } config; GtkCssProvider *style_provider; + gboolean no_maximize; }; gboolean vb_download_set_destination(Client *c, WebKitDownload *download, |