diff options
author | portix <portix@gmx.net> | 2012-12-07 00:44:45 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-12-07 00:44:45 +0100 |
commit | 6d228d4ff707158db60197592d7b231737f890c3 (patch) | |
tree | 8c69e6139c7bdad1975fc62fb167b2070a9ff3bf /src | |
parent | 4a656a2538eb4db0c5b66d78e25ba245e43ca03d (diff) | |
download | dwb-6d228d4ff707158db60197592d7b231737f890c3.zip |
Let focused view be starting point in find_webview
Diffstat (limited to 'src')
-rw-r--r-- | src/scripts.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/scripts.c b/src/scripts.c index 5ab7cfad..c19a0411 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -430,9 +430,13 @@ tabs_get_nth(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, siz static GList * find_webview(JSObjectRef o) { - GList *r = NULL; - for (r = dwb.state.views; r && VIEW(r)->script_wv != o; r=r->next); - return r; + for (GList *r = dwb.state.fview; r; r=r->next) + if (VIEW(r)->script_wv == o) + return r; + for (GList *r = dwb.state.fview->prev; r; r=r->prev) + if (VIEW(r)->script_wv == o) + return r; + return NULL; } /* wv_status_cb {{{*/ static gboolean |