From 50a45f80ab3689b52f3a4ae8eb6189f9cd096693 Mon Sep 17 00:00:00 2001 From: cos Date: Fri, 4 Apr 2014 14:59:47 +0200 Subject: Initial prototype to add support for geometry option. --- src/application.c | 1 + src/dwb.c | 4 +++- src/dwb.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/application.c b/src/application.c index 759cfc00..f81b1f3c 100644 --- a/src/application.c +++ b/src/application.c @@ -53,6 +53,7 @@ static GOptionEntry options[] = { { "check-script", 'c', 0, G_OPTION_ARG_FILENAME_ARRAY, &s_scripts, "Check script syntax of scripts", "script"}, { "embed", 'e', 0, G_OPTION_ARG_INT64, &dwb.gui.wid, "Embed into window with window id wid", "wid"}, { "force", 'f', 0, G_OPTION_ARG_NONE, &s_opt_force, "Force restoring a saved session, even if another process has restored the session", NULL }, + { "geometry", 'g', 0, G_OPTION_ARG_STRING, &dwb.misc.geometry, "Lorem ipsum dolor 'sit'", "geometry" }, { "list-sessions", 'l', 0, G_OPTION_ARG_NONE, &s_opt_list_sessions, "List saved sessions and exit", NULL }, { "fifo", 0, 0, G_OPTION_ARG_NONE, &s_opt_fallback, "Use a fifo for single-instance instead of dbus", NULL }, { "new-instance", 'n', 0, G_OPTION_ARG_NONE, &s_opt_single, "Open a new instance, overrides 'single-instance'", NULL}, diff --git a/src/dwb.c b/src/dwb.c index 2a731580..11ebf88d 100644 --- a/src/dwb.c +++ b/src/dwb.c @@ -4700,8 +4700,9 @@ dwb_init_gui() gtk_style_context_add_provider_for_screen(screen, GTK_STYLE_PROVIDER(provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); #endif - gtk_window_set_default_size(GTK_WINDOW(dwb.gui.window), GET_INT("default-width"), GET_INT("default-height")); +/* gtk_window_set_default_size(GTK_WINDOW(dwb.gui.window), GET_INT("default-width"), GET_INT("default-height")); gtk_window_set_geometry_hints(GTK_WINDOW(dwb.gui.window), NULL, NULL, GDK_HINT_MIN_SIZE); +*/ g_signal_connect(dwb.gui.window, "delete-event", G_CALLBACK(callback_delete_event), NULL); g_signal_connect(dwb.gui.window, "key-press-event", G_CALLBACK(callback_key_press), NULL); g_signal_connect(dwb.gui.window, "key-release-event", G_CALLBACK(callback_key_release), NULL); @@ -4803,6 +4804,7 @@ dwb_init_gui() #endif gtk_widget_show(dwb.gui.mainbox); gtk_widget_show(dwb.gui.vbox); + gtk_window_parse_geometry(dwb.gui.window, dwb.misc.geometry); gtk_widget_show(dwb.gui.window); g_signal_connect(dwb.gui.entry, "key-press-event", G_CALLBACK(callback_entry_key_press), NULL); diff --git a/src/dwb.h b/src/dwb.h index bf6c1c51..b697ef24 100644 --- a/src/dwb.h +++ b/src/dwb.h @@ -807,6 +807,7 @@ struct _Misc { char *hints; /* applied to all frames */ const char *profile; + const char *geometry; const char *default_search; gint find_delay; SoupSession *soupsession; -- cgit v1.2.3