From 39406e9fae65534cc6db278411869874f4b9381e Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 31 Aug 2021 17:13:43 +0300 Subject: X11: Tell SDL not to bypass window compositor IssueID #160 --- src/main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index efe96ad9..c8a9c335 100644 --- a/src/main.c +++ b/src/main.c @@ -68,6 +68,7 @@ int main(int argc, char **argv) { "DHE-RSA-AES256-GCM-SHA384"); SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1"); SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "1"); + SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0"); if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER)) { fprintf(stderr, "[SDL] init failed: %s\n", SDL_GetError()); return -1; -- cgit v1.2.3 From 3411bd76743bb95e9cf6f778f913cb5ce077a903 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 1 Sep 2021 17:21:41 +0300 Subject: Fixed encoding of % in URL query string --- src/gmutil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gmutil.c b/src/gmutil.c index 9bd74ee0..9552c2a1 100644 --- a/src/gmutil.c +++ b/src/gmutil.c @@ -610,7 +610,7 @@ const iString *canonicalUrl_String(const iString *d) { - all non-reserved characters decoded (i.e., it's an IRI) - expect for spaces, which are always `%20` This means a canonical URL can be used on a gemtext link line without modifications. */ - iString *canon = maybeUrlDecodeExclude_String(d, "/?:;#&= "); + iString *canon = maybeUrlDecodeExclude_String(d, "%/?:;#&= "); /* `canon` may now be NULL if nothing was decoded. */ if (indexOfCStr_String(canon ? canon : d, " ") != iInvalidPos || indexOfCStr_String(canon ? canon : d, "\n") != iInvalidPos) { -- cgit v1.2.3 From 11bf1f990329764568f706835d237a9ad4c9f25d Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 4 Sep 2021 07:21:29 +0300 Subject: Text: Fixed hang when wrapping a long word The simple text renderer would get stuck in an infinite loop when encountering a word that wouldn't fit on a line. IssueID #330 --- src/ui/text_simple.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ui/text_simple.c b/src/ui/text_simple.c index 3afc631a..e88b09a8 100644 --- a/src/ui/text_simple.c +++ b/src/ui/text_simple.c @@ -169,6 +169,7 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) { if (!notify_WrapText_(wrap, chPos, 0, iMax(xpos, xposExtend) - orig.x, iFalse)) { break; } + lastWordEnd = NULL; xpos = xposExtend = orig.x; ypos += d->height; prevCh = ch; @@ -240,21 +241,19 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) { iAssert(wrap); const char *wrapPos = currentPos; int advance = x1 - orig.x; - if (lastWordEnd != args->text.start && wrap->mode == word_WrapTextMode) { - wrapPos = skipSpace_CStr(lastWordEnd); + if (lastWordEnd && wrap->mode == word_WrapTextMode) { + wrapPos = skipSpace_CStr(lastWordEnd); /* go back */ wrapPos = iMin(wrapPos, args->text.end); advance = wrapAdvance; } -// if (args->continueFrom_out) { -// *args->continueFrom_out = wrapPos; -// } if (!notify_WrapText_(wrap, wrapPos, 0, advance, iFalse)) { break; } + lastWordEnd = NULL; xpos = xposExtend = orig.x; ypos += d->height; prevCh = 0; - chPos = wrapPos; /* go back */ + chPos = wrapPos; continue; } const int yLineMax = ypos + d->height; -- cgit v1.2.3