From: Dieter Plaetinck Date: Fri, 17 Jul 2009 19:15:21 +0000 (+0200) Subject: merge in bct's sweet code X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=f56fba67561269032027b1cb438354049a53ad8e;p=uzbl-mobile merge in bct's sweet code --- f56fba67561269032027b1cb438354049a53ad8e diff --cc AUTHORS index 75c64ba,3533097..cf2635b --- a/AUTHORS +++ b/AUTHORS @@@ -31,7 -31,7 +31,7 @@@ Contributors Aaron Griffin (phrakture) - Makefile patches to build on OSX Mason Larobina - os.environ.keys() & os.path.join fix in cookies.py, work on uzbl_tabbed.py (dequis) - Uzbl.run, birectional socket, javascript commands -- Brendan Taylor (bct) - various bugfixes ++ Brendan Taylor (bct) - various bugfixes, making misc variables much better using expand(), refactoring some internal var stuff Chris van Dijk (quigybo) - work on uzbl_tabbed.py Moritz Lenz - small doc fix Sergey Shepelev (temoto) - doc patch diff --cc uzbl.c index 81e66d9,278f3de..d7d0f83 --- a/uzbl.c +++ b/uzbl.c @@@ -63,16 -63,18 +63,18 @@@ Uzbl uzbl 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 } @@@ -592,6 -630,20 +630,20 @@@ scroll_horz(WebKitWebView* page, GArra } 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); @@@ -1825,6 -1695,8 +1695,8 @@@ set_var_value(gchar *name, gchar *val) 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); @@@ -2174,7 -2057,11 +2057,11 @@@ key_press_cb (GtkWidget* window, GdkEve 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) {