Move isPrimaryScreen() to Session
Summary:
Previously the code enabled sending emulated up/down key press events to
the terminal only if the current screen is the alternate buffer. The
problem with this approach is that when detaching a tab/view, a new
TerminalDisplay is constructed and _isPrimaryScreen is initialized to
true even though the current screen in the detached tab is the alternate
one.
Since the Session is preserved when detaching a tab, move that bit of
code to Session, and query the Session about the currently used screen
buffer.
Test Plan:
Before:
- Open a window with two tabs, and in one of them execute man man
- Make sure "Enable Alternate screen buffer scrolling" is enabled in the
current profile, and that you can can scroll in the alternate buffer
- Detach the tab showing the manual page, now scrolling doesn't work in
the alternate buffer
With the patch applied, scrolling should work after detaching the tab.
Reviewers: Konsole, hindenburg
Reviewed By: Konsole, hindenburg
Subscribers: konsole-devel
Tags: Konsole
Differential Revision: https://phabricator.kde.org/D13217