3 Commits

Author SHA1 Message Date
ArthurSonzogni
09eb2f7fb0 v6.0.2 2025-03-30 01:27:57 +01:00
Arthur Sonzogni
1144e13125 Apply @forworldm code review. (#1022)
See: https://github.com/ArthurSonzogni/FTXUI/pull/1021?notification_referrer_id=NT_kwDOAEieQrMxNTU3OTg4MDA1MDo0NzU5MTA2#discussion_r2019827970
2025-03-30 01:22:17 +01:00
Arthur Sonzogni
4ba7dd2c5e Window: Major crash fix. (#1021)
A patch handling focus was recently merged, but a special condition on
Windows was inverted, causing a segfault.

Bug:https://github.com/ArthurSonzogni/FTXUI/issues/1020
2025-03-29 12:51:08 +01:00
6 changed files with 30 additions and 23 deletions

View File

@@ -104,7 +104,7 @@ jobs:
--gcov-executable '${{ matrix.gcov_executable }}'; --gcov-executable '${{ matrix.gcov_executable }}';
- name: Windows - Test and coverage - name: Windows - Test and coverage
if: runner.os == 'Windows' && false if: runner.os == 'Windows'
working-directory: ./build working-directory: ./build
run: > run: >
OpenCppCoverage.exe OpenCppCoverage.exe

View File

@@ -1,6 +1,13 @@
Changelog Changelog
========= =========
6.0.2 (2025-03-30)
-----
### Component
- BugFix: Fix major crash on Windows affecting all components. See #1020
- BugFix: Fix focusRelative.
6.0.1 (2025-03-28) 6.0.1 (2025-03-28)
----- -----

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.12)
project(ftxui project(ftxui
LANGUAGES CXX LANGUAGES CXX
VERSION 6.0.1 VERSION 6.0.2
DESCRIPTION "C++ Functional Terminal User Interface." DESCRIPTION "C++ Functional Terminal User Interface."
) )

View File

@@ -372,7 +372,7 @@ include(FetchContent)
FetchContent_Declare(ftxui FetchContent_Declare(ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v6.0.1 GIT_TAG v6.0.2
) )
FetchContent_GetProperties(ftxui) FetchContent_GetProperties(ftxui)

View File

@@ -36,7 +36,7 @@ Decorator focusPositionRelative(float x, float y) {
void ComputeRequirement() override { void ComputeRequirement() override {
NodeDecorator::ComputeRequirement(); NodeDecorator::ComputeRequirement();
requirement_.focused.enabled = false; requirement_.focused.enabled = true;
requirement_.focused.node = this; requirement_.focused.node = this;
requirement_.focused.box.x_min = int(float(requirement_.min_x) * x_); requirement_.focused.box.x_min = int(float(requirement_.min_x) * x_);
requirement_.focused.box.y_min = int(float(requirement_.min_y) * y_); requirement_.focused.box.y_min = int(float(requirement_.min_y) * y_);

View File

@@ -125,27 +125,27 @@ void Render(Screen& screen, Node* node, Selection& selection) {
node->Select(selection); node->Select(selection);
} }
// Setting the cursor to the right position allow folks using CJK (China,
// Japanese, Korean, ...) characters to see their [input method editor]
// displayed at the right location. See [issue].
//
// [input method editor]:
// https://en.wikipedia.org/wiki/Input_method
//
// [issue]:
// https://github.com/ArthurSonzogni/FTXUI/issues/2#issuecomment-505282355
//
// Unfortunately, Microsoft terminal do not handle properly hiding the
// cursor. Instead the character under the cursor is hidden, which is a big
// problem. As a result, we can't enable setting cursor to the right
// location. It will be displayed at the bottom right corner.
// See:
// https://github.com/microsoft/terminal/issues/1203
// https://github.com/microsoft/terminal/issues/3093
if (node->requirement().focused.enabled if (node->requirement().focused.enabled
#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK) #if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
|| // Setting the cursor to the right position allow folks using CJK (China,
node->requirement().focused.cursor_shape == Screen::Cursor::Shape::Hidden // Japanese, Korean, ...) characters to see their [input method editor]
// displayed at the right location. See [issue].
//
// [input method editor]:
// https://en.wikipedia.org/wiki/Input_method
//
// [issue]:
// https://github.com/ArthurSonzogni/FTXUI/issues/2#issuecomment-505282355
//
// Unfortunately, Microsoft terminal do not handle properly hiding the
// cursor. Instead the character under the cursor is hidden, which is a
// big problem. As a result, we can't enable setting cursor to the right
// location. It will be displayed at the bottom right corner.
// See:
// https://github.com/microsoft/terminal/issues/1203
// https://github.com/microsoft/terminal/issues/3093
&&
node->requirement().focused.cursor_shape != Screen::Cursor::Shape::Hidden
#endif #endif
) { ) {
screen.SetCursor(Screen::Cursor{ screen.SetCursor(Screen::Cursor{