merge in bct's sweet code
authorDieter Plaetinck <dieter@plaetinck.be>
Fri, 17 Jul 2009 19:15:21 +0000 (21:15 +0200)
committerDieter Plaetinck <dieter@plaetinck.be>
Fri, 17 Jul 2009 19:15:21 +0000 (21:15 +0200)
1  2 
AUTHORS
uzbl.c

diff --cc 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
--- 1/uzbl.c
--- 2/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) {