summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-23 12:05:21 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-23 12:05:21 +0200
commit6f63a0b8cd3572d933ab93a71b05c6e2fc28d2d6 (patch)
tree55ff8e4974c5e43935036b4dc617d9e7abeb10db /src/ui/documentwidget.c
parent456ca26906e84e3cadd670328ed5dca7718da50c (diff)
DocumentWidget: Middle-click behavior on links
Mimic Firefox so that a normal middle-click opens a new tab in the background, and Shift-middle-click opens new tab in foreground. IssueID #152
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 146b0de7..fbfb94f3 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -2444,7 +2444,8 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
2444 return iTrue; 2444 return iTrue;
2445 } 2445 }
2446 if (ev->button.button == SDL_BUTTON_MIDDLE && d->hoverLink) { 2446 if (ev->button.button == SDL_BUTTON_MIDDLE && d->hoverLink) {
2447 postCommandf_App("open newtab:1 url:%s", 2447 postCommandf_App("open newtab:%d url:%s",
2448 SDL_GetModState() & KMOD_SHIFT ? 1 : 2,
2448 cstr_String(linkUrl_GmDocument(d->doc, d->hoverLink->linkId))); 2449 cstr_String(linkUrl_GmDocument(d->doc, d->hoverLink->linkId)));
2449 return iTrue; 2450 return iTrue;
2450 } 2451 }