summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorportix <none@none>2012-11-19 02:06:09 +0100
committerportix <none@none>2012-11-19 02:06:09 +0100
commitbd66e5045613123ee067f829185e3c15353470d3 (patch)
tree129e872c7b86e3f0b851b224a2f604e01f832354 /src
parenta96bbee0345af08002cc601ca9058e1108d7c29b (diff)
parent71d31739420672a487e7ab32d21b407512b5562a (diff)
downloaddwb-bd66e5045613123ee067f829185e3c15353470d3.zip
Merging http://bitbucket.org/portix/dwb into default
Diffstat (limited to 'src')
-rw-r--r--src/dwb.c3
-rw-r--r--src/dwb.h1
-rw-r--r--src/html.c6
-rw-r--r--src/view.c5
4 files changed, 10 insertions, 5 deletions
diff --git a/src/dwb.c b/src/dwb.c
index 9c9d9242..a5ff5984 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -2886,7 +2886,8 @@ dwb_get_scripts() {
continue;
else if (g_file_test(path, G_FILE_TEST_IS_SYMLINK)) {
realpath = g_file_read_link(path, &error);
- if (realpath == NULL) {
+ if (realpath != NULL) {
+ g_free(path);
fprintf(stderr, "Cannot read %s : %s\n", path, error->message);
goto loop_end;
}
diff --git a/src/dwb.h b/src/dwb.h
index b73dc2b2..c89dbfd1 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -665,6 +665,7 @@ struct _View {
GtkWidget *inspector_window;
ViewStatus *status;
Plugins *plugins;
+ WebKitWebSettings *settings;
struct {
WebKitDOMElement *element;
WebKitDOMElement *anchor;
diff --git a/src/html.c b/src/html.c
index 2637430f..81b39046 100644
--- a/src/html.c
+++ b/src/html.c
@@ -255,7 +255,7 @@ html_keydown_cb(WebKitDOMElement *el, WebKitDOMEvent *ev, WebKitWebView *wv) {
glong val = webkit_dom_ui_event_get_key_code(WEBKIT_DOM_UI_EVENT(ev));
if (val == 13) {
WebKitDOMEventTarget *target = webkit_dom_event_get_target(ev);
- if (target != NULL) {
+ if (target != NULL && WEBKIT_DOM_IS_ELEMENT(target)) {
return html_key_changed(WEBKIT_DOM_ELEMENT(target));
}
}
@@ -327,8 +327,10 @@ html_key_changed(WebKitDOMElement *target) {
char *value;
if (WEBKIT_DOM_IS_HTML_TEXT_AREA_ELEMENT(target))
value = webkit_dom_html_text_area_element_get_value(WEBKIT_DOM_HTML_TEXT_AREA_ELEMENT(target));
- else
+ else if (WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(target))
value = webkit_dom_html_input_element_get_value(WEBKIT_DOM_HTML_INPUT_ELEMENT(target));
+ else
+ return false;
char *id = webkit_dom_html_element_get_id(WEBKIT_DOM_HTML_ELEMENT(target));
if (g_strcmp0(id, "dwb_custom_keys_area")) {
diff --git a/src/view.c b/src/view.c
index 6b6ea1dd..fce39553 100644
--- a/src/view.c
+++ b/src/view.c
@@ -843,7 +843,8 @@ view_set_normal_style(GList *gl) {
static void
view_init_settings(GList *gl) {
View *v = gl->data;
- webkit_web_view_set_settings(WEBKIT_WEB_VIEW(v->web), webkit_web_settings_copy(dwb.state.web_settings));
+ v->settings = webkit_web_settings_copy(dwb.state.web_settings);
+ webkit_web_view_set_settings(WEBKIT_WEB_VIEW(v->web), v->settings);
GList *l;
for (l = g_hash_table_get_values(dwb.settings); l; l=l->next) {
WebSettings *s = l->data;
@@ -1057,7 +1058,7 @@ view_clean(GList *gl) {
g_object_unref(v->hover.element);
g_object_unref(v->status_element);
-
+ g_object_unref(v->settings);
/* Destroy widget */
gtk_widget_destroy(v->web);
gtk_widget_destroy(v->scroll);