From adb7b018d96a14061712e4b6ac57174b19b1057e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 26 Mar 2020 18:27:02 +0900 Subject: [PATCH] [qwaq] Improve focus setting The view is recorded as having focus but is not given focus until the parent view is actually in focus. This fixes the locals view not having focus at startup and thus blocking F7. --- ruamoko/qwaq/qwaq-group.r | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruamoko/qwaq/qwaq-group.r b/ruamoko/qwaq/qwaq-group.r index 11f724422..d94d0585f 100644 --- a/ruamoko/qwaq/qwaq-group.r +++ b/ruamoko/qwaq/qwaq-group.r @@ -97,7 +97,7 @@ trySetFocus (Group *self, int viewIndex) View *view = [self.views objectAtIndex:viewIndex]; if (([view state] & (sfDrawn | sfDisabled)) == sfDrawn && [view options] & ofCanFocus) { - if (!self.owner || [self.owner state] & sfInFocus) { + if (!self.owner || ([self.owner state] & sfInFocus)) { if (self.focused >= 0) { [[self.views objectAtIndex: self.focused] loseFocus]; } @@ -106,6 +106,8 @@ trySetFocus (Group *self, int viewIndex) self.focused = makeFirst (self, viewIndex); } [view takeFocus]; + } else { + self.focused = viewIndex; } return 1; }