summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2014-04-04 14:59:47 +0200
committercos <cos>2014-04-04 14:59:47 +0200
commit50a45f80ab3689b52f3a4ae8eb6189f9cd096693 (patch)
treec51d2818c61fd69f6263b88ebfa19c2f586abba0
parentb07751d84d485bc0d807a8838f93793be5edb652 (diff)
downloaddwb-50a45f80ab3689b52f3a4ae8eb6189f9cd096693.zip
Initial prototype to add support for geometry option.cr/add_geometry_option
-rw-r--r--src/application.c1
-rw-r--r--src/dwb.c4
-rw-r--r--src/dwb.h1
3 files changed, 5 insertions, 1 deletions
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;