const
GOptionEntry entries[] =
{
- { "uri", 'u', 0, G_OPTION_ARG_STRING, &uzbl.state.uri,
+ { "uri", 'u', 0, G_OPTION_ARG_STRING, &uzbl.state.uri,
"Uri to load at startup (equivalent to 'set uri = URI')", "URI" },
- { "verbose", 'v', 0, G_OPTION_ARG_NONE, &uzbl.state.verbose,
+ { "verbose", 'v', 0, G_OPTION_ARG_NONE, &uzbl.state.verbose,
"Whether to print all messages or just errors.", NULL },
- { "name", 'n', 0, G_OPTION_ARG_STRING, &uzbl.state.instance_name,
- { "name", 'n', 0, G_OPTION_ARG_STRING, &uzbl.state.instance_name,
++ { "name", 'n', 0, G_OPTION_ARG_STRING, &uzbl.state.instance_name,
"Name of the current instance (defaults to Xorg window id)", "NAME" },
- { "config", 'c', 0, G_OPTION_ARG_STRING, &uzbl.state.config_file,
- { "config", 'c', 0, G_OPTION_ARG_STRING, &uzbl.state.config_file,
++ { "config", 'c', 0, G_OPTION_ARG_STRING, &uzbl.state.config_file,
"Config file (this is pretty much equivalent to uzbl < FILE )", "FILE" },
- { "socket", 's', 0, G_OPTION_ARG_INT, &uzbl.state.socket_id,
- { "socket", 's', 0, G_OPTION_ARG_INT, &uzbl.state.socket_id,
++ { "socket", 's', 0, G_OPTION_ARG_INT, &uzbl.state.socket_id,
"Socket ID", "SOCKET" },
- { "geometry", 'g', 0, G_OPTION_ARG_STRING, &uzbl.gui.geometry,
++ { "geometry", 'g', 0, G_OPTION_ARG_STRING, &uzbl.gui.geometry,
+ "Set window geometry (format: WIDTHxHEIGHT+-X+-Y)", "GEOMETRY" },
{ "version", 'V', 0, G_OPTION_ARG_NONE, &uzbl.behave.print_version,
"Print the version and exit", NULL },
{ NULL, 0, 0, 0, NULL, NULL, NULL }
}
void
+ cmd_set_geometry() {
+ if(!gtk_window_parse_geometry(GTK_WINDOW(uzbl.gui.main_window), uzbl.gui.geometry)) {
+ if(uzbl.state.verbose)
+ printf("Error in geometry string: %s\n", uzbl.gui.geometry);
+ }
- /* update geometry var with the actual geometry
++ /* update geometry var with the actual geometry
+ this is necessary as some WMs don't seem to honour
+ the above setting and we don't want to end up with
+ wrong geometry information
+ */
+ retreive_geometry();
+ }
+
+ void
cmd_set_status() {
if (!uzbl.behave.show_status) {
gtk_widget_hide(uzbl.gui.mainbar);
char *buf = NULL;
if( (c = g_hash_table_lookup(uzbl.comm.proto_var, name)) ) {
- if(!c->writeable) return TRUE;
++ if(!c->writeable) return FALSE;
+
/* check for the variable type */
if (c->type == TYPE_STR) {
buf = expand(val, 0);
return TRUE;
}
- if (uzbl.behave.insert_mode && (((event->state & uzbl.behave.modmask) != uzbl.behave.modmask) || (!uzbl.behave.modmask)))
- if (uzbl.behave.insert_mode &&
- ( ((event->state & uzbl.behave.modmask) != uzbl.behave.modmask) ||
++ if (uzbl.behave.insert_mode &&
++ ( ((event->state & uzbl.behave.modmask) != uzbl.behave.modmask) ||
+ (!uzbl.behave.modmask)
+ )
+ )
return FALSE;
if (event->keyval == GDK_Escape) {