diff --git a/ChangeLog b/ChangeLog index 899656f9..d70418f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2021-04-21 Markus Gans + * Fixes the detection of the terminal size after a SIGWINCH signal + 2021-04-18 Markus Gans * Decoupling the FWidget and FWindow classes from FVTerm * Avoid redrawing widgets when show() is called multiple times diff --git a/src/Makefile.am b/src/Makefile.am index b85607e3..45743d85 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ # Makefile.am - FINAL CUT library #---------------------------------------------------------------------- -AM_CPPFLAGS = -Iinclude -Wall -Werror -DCOMPILE_FINAL_CUT -std=c++11 +AM_CPPFLAGS = -I$(top_srcdir)/src/include -Wall -Werror -DCOMPILE_FINAL_CUT -std=c++11 SUBDIRS = . @@ -79,7 +79,7 @@ libfinal_la_SOURCES = \ fwidget_functions.cpp \ fobject.cpp -libfinal_la_LDFLAGS = -version-info @SO_VERSION@ +libfinal_la_LDFLAGS = -no-undefined -version-info @SO_VERSION@ finalcutincludedir = $(includedir)/final diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 61194bb8..ebfde71c 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -1247,9 +1247,10 @@ FWidget* FApplication::processParameters (const Args& args) //---------------------------------------------------------------------- void FApplication::processResizeEvent() const { - if ( ! FTerm::hasChangedTermSize() ) + if ( ! FTerm::hasChangedTermSize() ) // A SIGWINCH signal was received return; + FTerm::detectTermSize(); // Detect and save the current terminal size const auto& mouse = FTerm::getFMouseControl(); mouse->setMaxWidth (uInt16(getDesktopWidth())); mouse->setMaxHeight (uInt16(getDesktopHeight())); diff --git a/src/fkeyboard.cpp b/src/fkeyboard.cpp index efbea2f3..ce45c27a 100644 --- a/src/fkeyboard.cpp +++ b/src/fkeyboard.cpp @@ -471,9 +471,7 @@ void FKeyboard::parseKeyBuffer() } // Read the rest from the fifo buffer - while ( ! isKeypressTimeout() - && fifo_offset > 0 - && fkey != FKey::Incomplete ) + while ( fifo_offset > 0 && fkey != FKey::Incomplete ) { fkey = parseKeyString(); fkey = keyCorrection(fkey); diff --git a/src/fvterm.cpp b/src/fvterm.cpp index 389e3bdf..8f1f7e9a 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -290,7 +290,6 @@ bool FVTerm::updateTerminal() const std::size_t changedlines = 0; - for (uInt y{0}; y < uInt(vterm->height); y++) { if ( updateTerminalLine(y) ) @@ -1082,7 +1081,7 @@ void FVTerm::putArea (const FPoint& pos, const FTermArea* area) } //---------------------------------------------------------------------- -int FVTerm::getLayer (FVTerm* obj) +int FVTerm::getLayer (const FVTerm* obj) { // returns the layer from the FVTerm object @@ -2895,7 +2894,6 @@ inline bool FVTerm::isTermSizeChanged() const return false; FObject::getCurrentTime (&last_term_size_check); - const auto& data = FTerm::getFTermData(); if ( ! data ) diff --git a/src/fwidget.cpp b/src/fwidget.cpp index c0e21563..41189ec8 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -666,14 +666,14 @@ bool FWidget::setCursorPos (const FPoint& pos) if ( area->hasOwner() ) { - const auto object = area->getOwner(); - int woffsetX = getTermX() - object->getTermX(); - int woffsetY = getTermY() - object->getTermY(); + const auto area_owner = area->getOwner(); + int woffsetX = getTermX() - area_owner->getTermX(); + int woffsetY = getTermY() - area_owner->getTermY(); if ( isChildPrintArea() ) { - woffsetX += (1 - object->getLeftPadding()); - woffsetY += (1 - object->getTopPadding()); + woffsetX += (1 - area_owner->getLeftPadding()); + woffsetY += (1 - area_owner->getTopPadding()); } bool visible = ! isCursorHideable() || flags.visible_cursor; @@ -1941,7 +1941,7 @@ void FWidget::setWindowFocus (bool enable) if ( ! window->isWindowActive() ) { bool has_raised = window->raiseWindow(); - window->setActiveWindow(window); + FWindow::setActiveWindow(window); if ( has_raised && window->isVisible() && window->isShown() ) window->redraw(); diff --git a/src/fwindow.cpp b/src/fwindow.cpp index 6a0e0fb4..866f997e 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -857,7 +857,7 @@ int FWindow::getWindowLayerImpl (FWidget* obj) { // returns the window layer from the widget obj - FWidget* window; + const FWidget* window; if ( ! obj->isWindowWidget() ) { diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index e219dd8d..992f044b 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -103,7 +103,7 @@ #include #include -#if F_HAVE_GETTTYNAM && F_HAVE_TTYENT_H +#if defined(F_HAVE_GETTTYNAM) && defined(F_HAVE_TTYENT_H) #include #endif diff --git a/src/include/final/fvterm.h b/src/include/final/fvterm.h index 014580ff..075d337b 100644 --- a/src/include/final/fvterm.h +++ b/src/include/final/fvterm.h @@ -281,7 +281,7 @@ class FVTerm static void getArea (const FRect&, const FTermArea*); void putArea (const FTermArea*) const; static void putArea (const FPoint&, const FTermArea*); - static int getLayer (FVTerm*); + static int getLayer (const FVTerm*); void scrollAreaForward (FTermArea*) const; void scrollAreaReverse (FTermArea*) const; void clearArea (FTermArea*, wchar_t = L' ') const;