add geometry switch (size in pixels)

This commit is contained in:
Daniel Micay 2012-06-11 23:50:45 -04:00
parent eb12f23cc9
commit dc9abb2244
1 changed files with 11 additions and 0 deletions

View File

@ -447,8 +447,10 @@ int main(int argc, char **argv) {
GOptionContext *context = g_option_context_new("[COMMAND]");
gchar *role = NULL;
char *geometry = NULL;
const GOptionEntry entries[] = {
{"role", 'r', 0, G_OPTION_ARG_STRING, &role, "The role to use", "ROLE"},
{"geometry", 0, 0, G_OPTION_ARG_STRING, &geometry, "Window geometry", "GEOMETRY"},
{NULL}
};
g_option_context_add_main_entries(context, entries, NULL);
@ -553,6 +555,15 @@ int main(int argc, char **argv) {
g_signal_connect(vte, "window-title-changed", G_CALLBACK(window_title_cb), window);
}
if (geometry) {
gtk_widget_show_all(overlay);
gtk_widget_show_all(alignment);
if (!gtk_window_parse_geometry(GTK_WINDOW(window), geometry)) {
g_printerr("Invalid geometry string: %s\n", geometry);
}
g_free(geometry);
}
gtk_widget_grab_focus(vte);
gtk_widget_show_all(window);
gtk_widget_hide(alignment);