summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-11-27 22:25:37 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-11-27 22:25:37 +0200
commit3b0e44cc32f4d45e37912d52fc2f2cd98f12da75 (patch)
tree1d67dc643c3ecda5d8f844a859ce4c85bd6dcf1c /src
parenta0ebb6485cf81468c41ccc68f91dbe8018e1c0a7 (diff)
DocumentWidget: Cancelling keyboard navigation mode
Cancel keyboard navigation mode when opening a new URL, reloading the current page, or when window loses focus. IssueID #71
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index a0dcb863..ef856558 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -896,6 +896,7 @@ static void fetch_DocumentWidget_(iDocumentWidget *d) {
896 postCommandf_App("document.request.started doc:%p url:%s", d, cstr_String(d->mod.url)); 896 postCommandf_App("document.request.started doc:%p url:%s", d, cstr_String(d->mod.url));
897 clear_ObjectList(d->media); 897 clear_ObjectList(d->media);
898 d->certFlags = 0; 898 d->certFlags = 0;
899 d->flags &= ~showLinkNumbers_DocumentWidgetFlag;
899 d->state = fetching_RequestState; 900 d->state = fetching_RequestState;
900 set_Atomic(&d->isRequestUpdated, iFalse); 901 set_Atomic(&d->isRequestUpdated, iFalse);
901 d->request = new_GmRequest(certs_App()); 902 d->request = new_GmRequest(certs_App());
@@ -1369,6 +1370,14 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1369 updateWindowTitle_DocumentWidget_(d); 1370 updateWindowTitle_DocumentWidget_(d);
1370 refresh_Widget(w); 1371 refresh_Widget(w);
1371 } 1372 }
1373 else if (equal_Command(cmd, "window.focus.lost")) {
1374 if (d->flags & showLinkNumbers_DocumentWidgetFlag) {
1375 d->flags &= ~showLinkNumbers_DocumentWidgetFlag;
1376 invalidateVisibleLinks_DocumentWidget_(d);
1377 refresh_Widget(w);
1378 }
1379 return iFalse;
1380 }
1372 else if (equal_Command(cmd, "window.mouse.exited")) { 1381 else if (equal_Command(cmd, "window.mouse.exited")) {
1373 updateOutlineOpacity_DocumentWidget_(d); 1382 updateOutlineOpacity_DocumentWidget_(d);
1374 return iFalse; 1383 return iFalse;
@@ -2899,6 +2908,7 @@ void deserializeState_DocumentWidget(iDocumentWidget *d, iStream *ins) {
2899} 2908}
2900 2909
2901void setUrlFromCache_DocumentWidget(iDocumentWidget *d, const iString *url, iBool isFromCache) { 2910void setUrlFromCache_DocumentWidget(iDocumentWidget *d, const iString *url, iBool isFromCache) {
2911 d->flags &= ~showLinkNumbers_DocumentWidgetFlag;
2902 if (cmpStringSc_String(d->mod.url, url, &iCaseInsensitive)) { 2912 if (cmpStringSc_String(d->mod.url, url, &iCaseInsensitive)) {
2903 set_String(d->mod.url, url); 2913 set_String(d->mod.url, url);
2904 /* See if there a username in the URL. */ 2914 /* See if there a username in the URL. */