adding fixes from thomas_adam. Thanks :)

This commit is contained in:
Enno Boland (tox) 2009-12-15 17:16:01 +01:00
parent f42461c3cc
commit 2f9c554f02
2 changed files with 26 additions and 1 deletions

8
surf.1
View file

@ -26,6 +26,8 @@ Prints version information to standard output, then exits.
Prints xid to standard output. This can be used to script the browser by using Prints xid to standard output. This can be used to script the browser by using
.BR xprop(1). .BR xprop(1).
.SH USAGE .SH USAGE
.B Escape
Stops loading current page or stops download.
.TP .TP
.B Ctrl\-h .B Ctrl\-h
Walks back the history. Walks back the history.
@ -51,6 +53,12 @@ Resets Zoom
.B Ctrl\-/ .B Ctrl\-/
Opens the search-bar. Opens the search-bar.
.TP .TP
.B Ctrl\-n
Go to next search result.
.TP
.B Ctrl\-Shift\-n
Go to previous search result.
.TP
.B Ctrl\-g .B Ctrl\-g
Opens the URL-bar. Opens the URL-bar.
.TP .TP

19
surf.c
View file

@ -467,7 +467,19 @@ newclient(void) {
} }
else { else {
c->win = gtk_window_new(GTK_WINDOW_TOPLEVEL); c->win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
/* TA: 20091214: Despite what the GNOME docs say, the ICCCM
* is always correct, so we should still call this function.
* But when doing so, we *must* differentiate between a
* WM_CLASS and a resource on the window. By convention, the
* window class (WM_CLASS) is capped, while the resource is in
* lowercase. Both these values come as a pair.
*/
gtk_window_set_wmclass(GTK_WINDOW(c->win), "surf", "surf"); gtk_window_set_wmclass(GTK_WINDOW(c->win), "surf", "surf");
/* TA: 20091214: And set the role here as well -- so that
* sessions can pick this up.
*/
gtk_window_set_role(GTK_WINDOW(c->win), "Surf");
} }
gtk_window_set_default_size(GTK_WINDOW(c->win), 800, 600); gtk_window_set_default_size(GTK_WINDOW(c->win), 800, 600);
g_signal_connect(G_OBJECT(c->win), "destroy", G_CALLBACK(destroywin), c); g_signal_connect(G_OBJECT(c->win), "destroy", G_CALLBACK(destroywin), c);
@ -684,6 +696,7 @@ void
setup(void) { setup(void) {
SoupSession *s; SoupSession *s;
char *proxy; char *proxy;
char *new_proxy;
SoupURI *puri; SoupURI *puri;
/* clean up any zombies immediately */ /* clean up any zombies immediately */
@ -709,9 +722,13 @@ setup(void) {
soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookies)); soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookies));
g_signal_connect(cookies, "changed", G_CALLBACK(changecookie), NULL); g_signal_connect(cookies, "changed", G_CALLBACK(changecookie), NULL);
if((proxy = getenv("http_proxy")) && strcmp(proxy, "")) { if((proxy = getenv("http_proxy")) && strcmp(proxy, "")) {
puri = soup_uri_new(proxy); new_proxy = g_strrstr(proxy, "http://") ? g_strdup(proxy) :
g_strdup_printf("http://%s", proxy);
puri = soup_uri_new(new_proxy);
g_object_set(G_OBJECT(s), "proxy-uri", puri, NULL); g_object_set(G_OBJECT(s), "proxy-uri", puri, NULL);
soup_uri_free(puri); soup_uri_free(puri);
g_free(new_proxy);
} }
reloadcookies(); reloadcookies();
} }