added 20h's patch of 8 Sep 2011 to surf, thanks
[surf.git] / surf.c
diff --git a/surf.c b/surf.c
index b2e7f20..85155b5 100644 (file)
--- a/surf.c
+++ b/surf.c
@@ -21,7 +21,6 @@
 #include <sys/file.h>
 
 #define LENGTH(x)               (sizeof x / sizeof x[0])
-#define CLEANMASK(mask)         (mask & ~(GDK_MOD2_MASK))
 
 enum { AtomFind, AtomGo, AtomUri, AtomLast };
 
@@ -211,6 +210,7 @@ void
 destroyclient(Client *c) {
        Client *p;
 
+       webkit_web_view_stop_loading(c->view);
        gtk_widget_destroy(c->indicator);
        gtk_widget_destroy(GTK_WIDGET(c->view));
        gtk_widget_destroy(c->scroll);
@@ -344,7 +344,7 @@ keypress(GtkWidget* w, GdkEventKey *ev, Client *c) {
        updatewinid(c);
        for(i = 0; i < LENGTH(keys); i++) {
                if(gdk_keyval_to_lower(ev->keyval) == keys[i].keyval
-                               && CLEANMASK(ev->state) == keys[i].mod
+                               && (ev->state & keys[i].mod) == keys[i].mod
                                && keys[i].func) {
                        keys[i].func(c, &(keys[i].arg));
                        processed = TRUE;
@@ -506,7 +506,7 @@ newclient(void) {
 
        setatom(c, AtomFind, "");
        setatom(c, AtomUri, "about:blank");
-       if(NOBACKGROUND)
+       if(HIDE_BACKGROUND)
                webkit_web_view_set_transparent(c->view, TRUE);
 
        c->title = NULL;