add geometry switch (size in pixels)
This commit is contained in:
parent
eb12f23cc9
commit
dc9abb2244
11
termite.c
11
termite.c
|
@ -447,8 +447,10 @@ int main(int argc, char **argv) {
|
||||||
|
|
||||||
GOptionContext *context = g_option_context_new("[COMMAND]");
|
GOptionContext *context = g_option_context_new("[COMMAND]");
|
||||||
gchar *role = NULL;
|
gchar *role = NULL;
|
||||||
|
char *geometry = NULL;
|
||||||
const GOptionEntry entries[] = {
|
const GOptionEntry entries[] = {
|
||||||
{"role", 'r', 0, G_OPTION_ARG_STRING, &role, "The role to use", "ROLE"},
|
{"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}
|
{NULL}
|
||||||
};
|
};
|
||||||
g_option_context_add_main_entries(context, entries, 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);
|
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_grab_focus(vte);
|
||||||
gtk_widget_show_all(window);
|
gtk_widget_show_all(window);
|
||||||
gtk_widget_hide(alignment);
|
gtk_widget_hide(alignment);
|
||||||
|
|
Loading…
Reference in New Issue