From 06ec274d009aeb0fbf017043c8f350762eb0ccc2 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 12 Mar 2017 20:29:10 +0100 Subject: [PATCH] Corrects directly the input cursor position on window moving --- ChangeLog | 3 +++ src/fdialog.cpp | 2 ++ src/fstring.cpp | 18 +++++++++--------- test/choice.cpp | 1 - 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index abcf84ca..8aa4f1f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2017-03-13 Markus Gans + * Corrects directly the input cursor position on window moving + 2017-03-12 Markus Gans * The FButtonGroup now has a scrolling area with on-demand scroll bars diff --git a/src/fdialog.cpp b/src/fdialog.cpp index db81eeba..15b25d35 100644 --- a/src/fdialog.cpp +++ b/src/fdialog.cpp @@ -279,12 +279,14 @@ void FDialog::setPos (int x, int y, bool) // set the cursor to the focus widget FWidget* focus_widget = FWidget::getFocusWidget(); + if ( focus_widget && focus_widget->isVisible() && focus_widget->hasVisibleCursor() ) { FPoint cursor_pos = focus_widget->getCursorPos(); focus_widget->setCursorPos(cursor_pos); + updateVTermCursor(vwin); } updateTerminal(); diff --git a/src/fstring.cpp b/src/fstring.cpp index ec0f5d3f..1a3e550d 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -111,15 +111,15 @@ FString::FString (uInt len, char c) } //---------------------------------------------------------------------- -FString::FString (const FString& s) // copy constructor - : string(0) - , length(0) - , bufsize(0) - , c_string(0) -{ - if ( s.string ) - _replace (s.string); -} +FString::FString (const FString& s) // copy constructor + : string(0) + , length(0) + , bufsize(0) + , c_string(0) +{ + if ( s.string ) + _replace (s.string); +} //---------------------------------------------------------------------- FString::FString (const std::wstring& s) diff --git a/test/choice.cpp b/test/choice.cpp index 63d5893b..d5be252f 100644 --- a/test/choice.cpp +++ b/test/choice.cpp @@ -41,7 +41,6 @@ int main (int argc, char* argv[]) x = (app.getColumnNumber() - w) / 2; y = (app.getLineNumber() - h) / 2; dgl->setGeometry (x, y, w, h); - dgl->setShadow(); // Create another button group FButtonGroup* checkButtonGroup = new FButtonGroup("choice", dgl);