summaryrefslogtreecommitdiff
path: root/debian/patches/fix-ftbfs-with-opaque-ncurses.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/fix-ftbfs-with-opaque-ncurses.patch')
-rw-r--r--debian/patches/fix-ftbfs-with-opaque-ncurses.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/debian/patches/fix-ftbfs-with-opaque-ncurses.patch b/debian/patches/fix-ftbfs-with-opaque-ncurses.patch
new file mode 100644
index 0000000..4e921fe
--- /dev/null
+++ b/debian/patches/fix-ftbfs-with-opaque-ncurses.patch
@@ -0,0 +1,52 @@
+From: Sven Joachim <svenjoac@gmx.de>
+Date: Thu, 21 Dec 2023 17:12:56 +0100
+Subject: Fix FTBFS with opaque ncurses
+
+Since ncurses patchlevel 20231021 the WINDOW structure is opaque, its
+members cannot be addressed directly. Use the getmaxy/getmaxx
+functions ncurses provides for this purpose instead.
+---
+ analyzers/src/watch/nc_windows/header_window.cpp | 2 +-
+ analyzers/src/watch/nc_windows/statistics_window.cpp | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/analyzers/src/watch/nc_windows/header_window.cpp b/analyzers/src/watch/nc_windows/header_window.cpp
+index 8e04818..64ff716 100644
+--- a/analyzers/src/watch/nc_windows/header_window.cpp
++++ b/analyzers/src/watch/nc_windows/header_window.cpp
+@@ -87,7 +87,7 @@ void HeaderWindow::resize(MainWindow& m)
+ }
+ if(m._window != nullptr)
+ {
+- _window = subwin(m._window, std::min(static_cast<int>(m._window->_maxy), GUI_HEADER_HEIGHT), std::min(static_cast<int>(m._window->_maxx), GUI_LENGTH), 0, 0);
++ _window = subwin(m._window, std::min(static_cast<int>(getmaxy(m._window) - 1 ), GUI_HEADER_HEIGHT), std::min(static_cast<int>(getmaxx(m._window) - 1 ), GUI_LENGTH), 0, 0);
+ }
+ if(_window != nullptr)
+ {
+diff --git a/analyzers/src/watch/nc_windows/statistics_window.cpp b/analyzers/src/watch/nc_windows/statistics_window.cpp
+index dccd980..748e3c2 100644
+--- a/analyzers/src/watch/nc_windows/statistics_window.cpp
++++ b/analyzers/src/watch/nc_windows/statistics_window.cpp
+@@ -50,7 +50,7 @@ void StatisticsWindow::destroy()
+
+ bool StatisticsWindow::canWrite(unsigned int i)
+ {
+- return (i >= _scrollOffset.at(_activeProtocol) + STATISTICS::FIRST_OPERATION_LINE && i - _scrollOffset.at(_activeProtocol) + BORDER_SIZE < static_cast<unsigned int>(_window->_maxy));
++ return (i >= _scrollOffset.at(_activeProtocol) + STATISTICS::FIRST_OPERATION_LINE && i - _scrollOffset.at(_activeProtocol) + BORDER_SIZE < static_cast<unsigned int>(getmaxy(_window) - 1));
+ }
+
+ StatisticsWindow::StatisticsWindow(MainWindow& w, StatisticsContainers& c)
+@@ -182,10 +182,10 @@ void StatisticsWindow::resize(MainWindow& m)
+ {
+ tmp_size = _activeProtocol->getAmount() + 2 * BORDER_SIZE + 2 * EMPTY_LINE + STATISTICS::PROTOCOLS_LINE + _activeProtocol->getGroups() * EMPTY_LINE * _activeProtocol->getGroups();
+ }
+- if(m._window != nullptr && m._window->_maxy > GUI_HEADER_HEIGHT)
++ if(m._window != nullptr && getmaxy(m._window) - 1 > GUI_HEADER_HEIGHT)
+ {
+- _window = subwin(m._window, std::min(static_cast<int>(m._window->_maxy - GUI_HEADER_HEIGHT), tmp_size),
+- std::min(static_cast<int>(m._window->_maxx), GUI_LENGTH), GUI_HEADER_HEIGHT - BORDER_SIZE, 0);
++ _window = subwin(m._window, std::min(static_cast<int>(getmaxy(m._window) - 1 - GUI_HEADER_HEIGHT), tmp_size),
++ std::min(static_cast<int>(getmaxx(m._window) - 1), GUI_LENGTH), GUI_HEADER_HEIGHT - BORDER_SIZE, 0);
+ updateProtocol(_activeProtocol);
+ }
+ }