From f81dcd10b9c09524a00b3b819679eca1d7ad6bf5 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 14 Feb 2021 14:20:13 +0200 Subject: SidebarWidget: Handling feed entry URLs with spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sidebar failed to realize that an entry was the current one and/or already read, because URL encoding is not consistently applied. This needs addressing soon — internally, all URLs should have a consistent format (fully encoded or decoded, NFC normalized). --- src/ui/sidebarwidget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ui/sidebarwidget.c') diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index dc1a60dc..679d8e6f 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -134,7 +134,8 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { d->menu = NULL; switch (d->mode) { case feeds_SidebarMode: { - const iString *docUrl = url_DocumentWidget(document_App()); + const iString *docUrl = withSpacesEncoded_String(url_DocumentWidget(document_App())); + /* TODO: internal URI normalization */ iTime now; iDate on; initCurrent_Time(&now); @@ -490,6 +491,7 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) { d->list = new_ListWidget(); setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI); addChild_Widget(content, iClob(d->list)); + d->contextItem = NULL; d->blank = new_Widget(); addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag); addChildFlags_Widget(vdiv, iClob(content), expand_WidgetFlag); @@ -1037,6 +1039,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) } if (d->menu && ev->type == SDL_MOUSEBUTTONDOWN) { if (ev->button.button == SDL_BUTTON_RIGHT) { + d->contextItem = NULL; if (!isVisible_Widget(d->menu)) { updateMouseHover_ListWidget(d->list); } -- cgit v1.2.3