From <jim_l@xxxxxxxxxxxx>:
jim_l@xxxxxxxxxxxx has uploaded this change for review. (
https://review.haiku-os.org/c/haiku/+/5416 ;)
Change subject: StyledEdit: give initial focus to the TextView
......................................................................
StyledEdit: give initial focus to the TextView
* Move the existing MakeFocus call to after the window layout is built.
* Also, add calls to Activate so that StyledEdit becomes the active
window after its find or replace window is closed/hidden, even if
another application is set to 'always on top.'
* Fixes #17733.
Change-Id: I8380e8ce2760ffa3f3467a618a0d843826e4ac99
---
M src/apps/stylededit/StyledEditWindow.cpp
1 file changed, 8 insertions(+), 1 deletion(-)
git pull ssh://git.haiku-os.org:22/haiku refs/changes/16/5416/1
diff --git a/src/apps/stylededit/StyledEditWindow.cpp
b/src/apps/stylededit/StyledEditWindow.cpp
index c65574b..cb8f3f8 100644
--- a/src/apps/stylededit/StyledEditWindow.cpp
+++ b/src/apps/stylededit/StyledEditWindow.cpp
@@ -268,11 +268,15 @@
case MSG_FIND_WINDOW_QUIT:
{
fFindWindow = NULL;
+ Activate();
+ // In case any 'always on top' application
tries to make its
+ // window active after fFindWindow is closed.
break;
}
case MSG_REPLACE_WINDOW_QUIT:
{
fReplaceWindow = NULL;
+ Activate();
break;
}
case MSG_SEARCH:
@@ -283,6 +287,7 @@
message->FindBool("backsearch", &fBackSearch);
_Search(fStringToFind, fCaseSensitive, fWrapAround,
fBackSearch);
+ Activate();
break;
case MENU_FIND_AGAIN:
_Search(fStringToFind, fCaseSensitive, fWrapAround,
fBackSearch);
@@ -323,6 +328,7 @@
_Replace(fStringToFind, fReplaceString, fCaseSensitive,
fWrapAround,
fBackSearch);
+ Activate();
break;
}
case MENU_REPLACE_SAME:
@@ -346,6 +352,7 @@
SearchAllWindows(fStringToFind, fReplaceString,
fCaseSensitive);
else
_ReplaceAll(fStringToFind, fReplaceString,
fCaseSensitive);
+ Activate();
break;
}
@@ -1163,7 +1170,6 @@
fScrollView = new BScrollView("scrollview", fTextView, B_FOLLOW_ALL, 0,
true, true, B_PLAIN_BORDER);
- fTextView->MakeFocus(true);
fStatusView = new StatusView(fScrollView);
fScrollView->AddChild(fStatusView);
@@ -1360,6 +1366,7 @@
.End();
SetKeyMenuBar(mainMenu);
+ fTextView->MakeFocus(true);
}
--
To view, visit https://review.haiku-os.org/c/haiku/+/5416
To unsubscribe, or for help writing mail filters, visit
https://review.haiku-os.org/settings
Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I8380e8ce2760ffa3f3467a618a0d843826e4ac99
Gerrit-Change-Number: 5416
Gerrit-PatchSet: 1
Gerrit-Owner: jim_l@xxxxxxxxxxxx
Gerrit-MessageType: newchange