=> 0b80601b2ebd2765878f0829bff656a4f65bbf1f
[1mdiff --git a/src/app.c b/src/app.c[m [1mindex 2aa08247..d3cced8e 100644[m [1m--- a/src/app.c[m [1m+++ b/src/app.c[m [36m@@ -1767,12 +1767,15 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m /* Focus cycling. */[m if (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_TAB) {[m iWidget *startFrom = focus_Widget();[m [32m+[m[32m const iBool isLimitedFocus = focusRoot_Widget(startFrom) != root_Widget(startFrom);[m /* Go to a sidebar if one is visible. */[m [31m- if (!startFrom && isVisible_Widget(findWidget_App("sidebar"))) {[m [32m+[m[32m if (!startFrom && !isLimitedFocus &&[m[41m [m [32m+[m[32m isVisible_Widget(findWidget_App("sidebar"))) {[m setFocus_Widget(as_Widget([m list_SidebarWidget((iSidebarWidget *) findWidget_App("sidebar"))));[m }[m [31m- else if (!startFrom && isVisible_Widget(findWidget_App("sidebar2"))) {[m [32m+[m[32m else if (!startFrom && !isLimitedFocus &&[m[41m [m [32m+[m[32m isVisible_Widget(findWidget_App("sidebar2"))) {[m setFocus_Widget(as_Widget([m list_SidebarWidget((iSidebarWidget *) findWidget_App("sidebar2"))));[m }[m [36m@@ -1785,6 +1788,21 @@[m [mvoid processEvents_App(enum iAppEventMode eventMode) {[m wasUsed = iTrue;[m }[m }[m [32m+[m[32m if (!wasUsed) {[m [32m+[m[32m /* ^G is an alternative for Escape. */[m [32m+[m[32m if (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == 'g' &&[m [32m+[m[32m keyMods_Sym(ev.key.keysym.mod) == KMOD_CTRL) {[m [32m+[m[32m SDL_KeyboardEvent esc = ev.key;[m [32m+[m[32m esc.keysym.sym = SDLK_ESCAPE;[m [32m+[m[32m esc.keysym.mod = 0;[m [32m+[m[32m SDL_PushEvent((SDL_Event *) &esc);[m [32m+[m[32m esc.state = SDL_RELEASED;[m [32m+[m[32m esc.type = SDL_KEYUP;[m [32m+[m[32m esc.timestamp++;[m [32m+[m[32m SDL_PushEvent((SDL_Event *) &esc);[m [32m+[m[32m wasUsed = iTrue;[m [32m+[m[32m }[m [32m+[m[32m }[m if (ev.type == SDL_USEREVENT && ev.user.code == command_UserEventCode) {[m #if defined (iPlatformAppleDesktop)[m handleCommand_MacOS(command_UserEvent(&ev));[m [36m@@ -3890,7 +3908,7 @@[m [miBool handleCommand_App(const char *cmd) {[m iWidget *idPanel = panel_Mobile(dlg, 3);[m iWidget *button = findUserData_Widget(findChild_Widget(dlg, "panel.top"), idPanel);[m postCommand_Widget(button, "panel.open");[m [31m- }[m [32m+[m[32m }[m }[m else if (equal_Command(cmd, "navigate.home")) {[m /* Look for bookmarks tagged "homepage". */[m [1mdiff --git a/src/ui/widget.c b/src/ui/widget.c[m [1mindex ed37fc5d..b0efeabf 100644[m [1m--- a/src/ui/widget.c[m [1m+++ b/src/ui/widget.c[m [36m@@ -2166,21 +2166,27 @@[m [mstatic const iWidget *findFocusRoot_Widget_(const iWidget *d) {[m return NULL;[m }[m [m [32m+[m[32mconst iWidget *focusRoot_Widget(const iWidget *d) {[m [32m+[m[32m iRoot *uiRoot = (d ? d->root : get_Window()->keyRoot);[m [32m+[m[32m return findFocusRoot_Widget_(uiRoot->widget);[m [32m+[m[32m}[m [32m+[m iAny *findFocusable_Widget(const iWidget *startFrom, enum iWidgetFocusDir focusDir) {[m if (!get_Window()) {[m return NULL;[m }[m [31m- iRoot *uiRoot = (startFrom ? startFrom->root : get_Window()->keyRoot);[m [31m- const iWidget *focusRoot = findFocusRoot_Widget_(uiRoot->widget);[m [32m+[m[32m const iWidget *focusRoot = focusRoot_Widget(startFrom);[m iAssert(focusRoot != NULL);[m iBool getNext = (startFrom ? iFalse : iTrue);[m const iWidget *found = findFocusable_Widget_(focusRoot, startFrom, &getNext, focusDir);[m if (!found && startFrom) {[m getNext = iTrue;[m /* Switch to the next root, if available. */[m [31m- found = findFocusable_Widget_(findFocusRoot_Widget_(otherRoot_Window(get_Window(),[m [31m- uiRoot)->widget),[m [31m- NULL, &getNext, focusDir);[m [32m+[m[32m found = findFocusable_Widget_([m [32m+[m[32m findFocusRoot_Widget_(otherRoot_Window(get_Window(), focusRoot->root)->widget),[m [32m+[m[32m NULL,[m [32m+[m[32m &getNext,[m [32m+[m[32m focusDir);[m }[m return iConstCast(iWidget *, found);[m }[m [1mdiff --git a/src/ui/widget.h b/src/ui/widget.h[m [1mindex 44020eff..5ce884c9 100644[m [1m--- a/src/ui/widget.h[m [1m+++ b/src/ui/widget.h[m [36m@@ -336,6 +336,7 @@[m [mvoid scrollInfo_Widget (const iWidget *, iWidgetScrollInfo *inf[m [m int backgroundFadeColor_Widget (void);[m [m [32m+[m[32mconst iWidget *focusRoot_Widget (const iWidget *);[m void setFocus_Widget (iWidget *); /* widget must be flagged `focusable` */[m void setKeyboardGrab_Widget (iWidget *); /* sets focus on any widget */[m iWidget * focus_Widget (void);[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).