From 3c1d486284880f27dbb4ebabf0bee21ce90daca3 Mon Sep 17 00:00:00 2001 From: Waweic Date: Tue, 3 Nov 2020 13:32:17 +0100 Subject: DocumentWidget: Adapt new tab behaviour to keyboard browsing --- src/ui/documentwidget.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 5e30cc2a..bacf8ff7 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1796,9 +1796,13 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e const iGmRun *run = i.ptr; if (run->flags & decoration_GmRunFlag && visibleLinkOrdinal_DocumentWidget_(d, run->linkId) == ord) { + const int kmods = keyMods_Sym(SDL_GetModState()); postCommandf_App("open newtab:%d url:%s", - (SDL_GetModState() & KMOD_PRIMARY) != 0, - cstr_String(linkUrl_GmDocument(d->doc, run->linkId))); + ((kmods & KMOD_PRIMARY) && (kmods & KMOD_SHIFT)) ? 1 + : (kmods & KMOD_PRIMARY) ? 2 + : 0, + cstr_String(absoluteUrl_String( + d->mod.url, linkUrl_GmDocument(d->doc, run->linkId)))); return iTrue; } } -- cgit v1.2.3