Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: restore focus of last split when restoring #5080

Merged
merged 2 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- Bugfix: Fixed avatar in usercard and moderation button triggering when releasing the mouse outside their area. (#5052)
- Bugfix: Fixed moderator-only topics being subscribed to for non-moderators. (#5056)
- Bugfix: Fixed a bug where buttons would remain in a hovered state after leaving them. (#5077)
- Bugfix: Fixed splits not retaining their focus after minimizing. (#5080)
- Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978)
- Dev: Change clang-format from v14 to v16. (#4929)
- Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791)
Expand Down
14 changes: 10 additions & 4 deletions src/widgets/Notebook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1332,13 +1332,19 @@ SplitNotebook::SplitNotebook(Window *parent)
});
}

void SplitNotebook::showEvent(QShowEvent *)
void SplitNotebook::showEvent(QShowEvent * /*event*/)
{
if (auto page = this->getSelectedPage())
if (auto *page = this->getSelectedPage())
{
if (auto split = page->findChild<Split *>())
auto *split = page->getSelectedSplit();
if (!split)
{
split->setFocus(Qt::FocusReason::OtherFocusReason);
split = page->findChild<Split *>();
}

if (split)
{
split->setFocus(Qt::OtherFocusReason);
}
}
}
Expand Down
Loading