/* associate command names to their properties */
typedef struct {
- /* TODO: Make this ambiguous void **ptr into a union { char *char_p; int *int_p; float *float_p; } val;
- the PTR() macro is kind of preventing this change at the moment. */
enum ptr_type type;
union {
int *i;
const struct var_name_to_ptr_t *n2v_p = var_name_to_ptr;
uzbl.comm.proto_var = g_hash_table_new(g_str_hash, g_str_equal);
while(n2v_p->name) {
- g_hash_table_insert(uzbl.comm.proto_var, n2v_p->name, (gpointer) &n2v_p->cp);
+ g_hash_table_insert(uzbl.comm.proto_var,
+ (gpointer) n2v_p->name,
+ (gpointer) &n2v_p->cp);
n2v_p++;
}
}
vend = strstr(s, "]@");
if(!vend) vend = strchr(s, '\0');
break;
+ /*@notreached@*/
+ case EXP_ERR:
+ break;
}
assert(vend);
if( (c = g_hash_table_lookup(uzbl.comm.proto_var, ret)) ) {
if(c->type == TYPE_STR && *c->ptr.s != NULL) {
g_string_append(buf, (gchar *)*c->ptr.s);
- } else if(c->type == TYPE_INT) {
+ }
+ else if(c->type == TYPE_INT) {
g_string_append_printf(buf, "%d", *c->ptr.i);
}
else if(c->type == TYPE_FLOAT) {
uzbl.behave.commands = g_hash_table_new(g_str_hash, g_str_equal);
for (i = 0; i < LENGTH(cmdlist); i++)
- g_hash_table_insert(uzbl.behave.commands, cmdlist[i].key, &cmdlist[i].value);
+ g_hash_table_insert(uzbl.behave.commands, (gpointer) cmdlist[i].key, &cmdlist[i].value);
}
/* -- CORE FUNCTIONS -- */
uzbl.gui.bar_h = gtk_range_get_adjustment((GtkRange*) uzbl.gui.scbar_h);
gtk_widget_set_scroll_adjustments ((GtkWidget*) uzbl.gui.web_view, uzbl.gui.bar_h, uzbl.gui.bar_v);
- if(uzbl.gui.geometry)
- cmd_set_geometry();
- else
- retrieve_geometry();
+ /* Check uzbl is in window mode before getting/setting geometry */
+ if (uzbl.gui.main_window) {
+ if(uzbl.gui.geometry)
+ cmd_set_geometry();
+ else
+ retrieve_geometry();
+ }
gchar *uri_override = (uzbl.state.uri ? g_strdup(uzbl.state.uri) : NULL);
if (argc > 1 && !uzbl.state.uri)