-
-
Notifications
You must be signed in to change notification settings - Fork 126
Fix multiple windows and tabs support #1739
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
Conversation
205b526
to
b1a89f7
Compare
b1a89f7
to
502cd09
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- metainfo.xml: Language not supported
6c4e0c3
to
5723019
Compare
5723019
to
2ac0fda
Compare
c1747bf
to
d9d554c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing I've committed and pushed right away, but some more comments I still wanted to leave :)
cd91d85
to
20e0a01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for multiple windows and tabs by tracking sessions per display, adding handlers to properly close sessions on window close or termination, and introduces atomic flags to coordinate session creation and switching.
- Add
onClosing
QML handler to remove a session when its window closes - Update termination logic to choose between closing a window or a tab via
canCloseWindow()
- Implement a
displayStates
map inTerminalSessionManager
to manage sessions per display
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/contour/ui/main.qml | Added onClosing handler to call terminalSessions.closeWindow() |
src/contour/ui/Terminal.qml | Changed onTerminated to use canCloseWindow() for window vs tab |
src/contour/display/TerminalDisplay.h | Removed outdated comment about single-terminal limitation |
src/contour/display/TerminalDisplay.cpp | Notify session manager on focus-in event |
src/contour/TerminalSessionManager.h | Added displayStates , closeWindow , canCloseWindow , etc. |
src/contour/TerminalSessionManager.cpp | Major multi-display/session logic, focus management, and closing |
src/contour/TerminalSession.h | Exposed getTerminalManager() |
src/contour/TerminalSession.cpp | Notify manager on session termination and coordinate new tabs |
src/contour/ContourGuiApp.cpp | Removed direct display assignment in newWindow() |
metainfo.xml | Documented the multiple windows/tabs fix |
CMakeLists.txt | Added /bigobj compile flag for MSVC |
.github/actions/spelling/allow/uncategorized.txt | Allowed bigobj in spelling whitelist |
Comments suppressed due to low confidence (3)
src/contour/TerminalSessionManager.h:59
- [nitpick] Method name
FocusOnDisplay
uses uppercase first letter, but other methods use lowerCamelCase. Rename it tofocusOnDisplay
for consistency.
void FocusOnDisplay(display::TerminalDisplay* display);
src/contour/TerminalSessionManager.cpp:384
- New logic in
tryFindSessionForDisplayOrClose
and window/tab management is complex; consider adding unit tests to cover behavior when sessions equal, exceed, or are fewer than displays.
void TerminalSessionManager::tryFindSessionForDisplayOrClose()
src/contour/ui/Terminal.qml:199
- The
else
branch for closing a tab was removed; ifcanCloseWindow()
is false, nothing happens. Restore or add a fallback to callterminalSessions.closeTab()
.
if (terminalSessions.canCloseWindow())
222a3ae
to
a113497
Compare
a113497
to
2b417aa
Compare
Signed-off-by: Christian Parpart <[email protected]>
2b417aa
to
a2aa73f
Compare
I tested this on windows and it is save to use in release build, debug might throw here and there issues because of the state verification but this is timing issues with windows and we check it on linux more thoughtful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this! 😄
closes #1725
closes #1728
closes #1729
closes #1730