From 77169b618d1130187cb699f9761cab18f0c7b0a6 Mon Sep 17 00:00:00 2001 From: rbrugo Date: Tue, 7 Nov 2023 11:26:06 +0100 Subject: [PATCH] fix: split fullscreen functions --- include/ftxui/component/screen_interactive.hpp | 3 ++- src/ftxui/component/screen_interactive.cpp | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/ftxui/component/screen_interactive.hpp b/include/ftxui/component/screen_interactive.hpp index d88da428..1b008cc9 100644 --- a/include/ftxui/component/screen_interactive.hpp +++ b/include/ftxui/component/screen_interactive.hpp @@ -31,8 +31,9 @@ class ScreenInteractive : public Screen { // Constructors: static ScreenInteractive FixedSize(int dimx, int dimy); static ScreenInteractive Fullscreen(); + static ScreenInteractive FullscreenPrimaryScreen(); static ScreenInteractive FitComponent(); - static ScreenInteractive TerminalOutput(bool use_alternative_screen = true); + static ScreenInteractive TerminalOutput(); // Options. Must be called before Loop(). void TrackMouse(bool enable = true); diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index 3f821a14..d99bf3c4 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -353,12 +353,22 @@ ScreenInteractive ScreenInteractive::FixedSize(int dimx, int dimy) { } // static -ScreenInteractive ScreenInteractive::Fullscreen(bool use_alternative_screen) { +ScreenInteractive ScreenInteractive::Fullscreen() { return { 0, 0, Dimension::Fullscreen, - use_alternative_screen, + true, + }; +} + +// static +ScreenInteractive ScreenInteractive::FullscreenPrimaryScreen() { + return { + 0, + 0, + Dimension::Fullscreen, + false, }; }