diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-03 15:17:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-03 15:17:21 +0200 |
commit | 3b5adaca9447632023fb5b5bd0a8e98427f290a4 (patch) | |
tree | 977ce03add597b8d275fcc15fa6425864cfd0eba /src/ui | |
parent | 4e076de8be2fd29d4c6489a041cc4b67a0246c2e (diff) | |
parent | 3c1d486284880f27dbb4ebabf0bee21ce90daca3 (diff) |
Merge pull request #21 from waweic/newtab-background
DocumentWidget: Adapt new tab behaviour to keyboard browsing
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/documentwidget.c | 8 |
1 files changed, 6 insertions, 2 deletions
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 | |||
1796 | const iGmRun *run = i.ptr; | 1796 | const iGmRun *run = i.ptr; |
1797 | if (run->flags & decoration_GmRunFlag && | 1797 | if (run->flags & decoration_GmRunFlag && |
1798 | visibleLinkOrdinal_DocumentWidget_(d, run->linkId) == ord) { | 1798 | visibleLinkOrdinal_DocumentWidget_(d, run->linkId) == ord) { |
1799 | const int kmods = keyMods_Sym(SDL_GetModState()); | ||
1799 | postCommandf_App("open newtab:%d url:%s", | 1800 | postCommandf_App("open newtab:%d url:%s", |
1800 | (SDL_GetModState() & KMOD_PRIMARY) != 0, | 1801 | ((kmods & KMOD_PRIMARY) && (kmods & KMOD_SHIFT)) ? 1 |
1801 | cstr_String(linkUrl_GmDocument(d->doc, run->linkId))); | 1802 | : (kmods & KMOD_PRIMARY) ? 2 |
1803 | : 0, | ||
1804 | cstr_String(absoluteUrl_String( | ||
1805 | d->mod.url, linkUrl_GmDocument(d->doc, run->linkId)))); | ||
1802 | return iTrue; | 1806 | return iTrue; |
1803 | } | 1807 | } |
1804 | } | 1808 | } |