Skip to content

Commit c4e370b

Browse files
Fix(nk_property): property widget not updating 'win->edit.active' state
Other "editable" widgets are updating the its window 'edit.active' state, but not nk_property. SDL3 demo needs this in order to hook SDL_SetTextInput. This patch was initially proposed by https://github.com/rswinkle The only thing I changed in it, was a removal of 'edit.name' update, nk_property is not using the name hash, so there is no reason to set it. Origin: #852 (comment) Co-authored-by: Robert Winkler <[email protected]>
1 parent fcd64f8 commit c4e370b

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎nuklear.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29073,6 +29073,7 @@ nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant
2907329073
win->property.name = hash;
2907429074
win->property.select_start = *select_begin;
2907529075
win->property.select_end = *select_end;
29076+
win->edit.active = nk_true;
2907629077
if (*state == NK_PROPERTY_DRAG) {
2907729078
ctx->input.mouse.grab = nk_true;
2907829079
ctx->input.mouse.grabbed = nk_true;
@@ -29088,6 +29089,7 @@ nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant
2908829089
win->property.select_start = 0;
2908929090
win->property.select_end = 0;
2909029091
win->property.active = 0;
29092+
win->edit.active = nk_false;
2909129093
}
2909229094
}
2909329095
NK_API void
@@ -30729,6 +30731,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
3072930731
/// - [y]: Minor version with non-breaking API and library changes
3073030732
/// - [z]: Patch version with no direct changes to the API
3073130733
///
30734+
/// - 2025/11/08 (4.13.0) - Fix: nk_property not updating 'win->edit.active'
3073230735
/// - 2025/10/08 (4.12.8) - Fix nk_widget_text to use NK_TEXT_ALIGN_LEFT by default,
3073330736
/// instead of silently failing when no x-axis alignment is provided,
3073430737
/// and refactor this function to keep the code style consistent

‎src/CHANGELOG‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/// - [y]: Minor version with non-breaking API and library changes
88
/// - [z]: Patch version with no direct changes to the API
99
///
10+
/// - 2025/11/08 (4.13.0) - Fix: nk_property not updating 'win->edit.active'
1011
/// - 2025/10/08 (4.12.8) - Fix nk_widget_text to use NK_TEXT_ALIGN_LEFT by default,
1112
/// instead of silently failing when no x-axis alignment is provided,
1213
/// and refactor this function to keep the code style consistent

‎src/nuklear_property.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant
405405
win->property.name = hash;
406406
win->property.select_start = *select_begin;
407407
win->property.select_end = *select_end;
408+
win->edit.active = nk_true;
408409
if (*state == NK_PROPERTY_DRAG) {
409410
ctx->input.mouse.grab = nk_true;
410411
ctx->input.mouse.grabbed = nk_true;
@@ -420,6 +421,7 @@ nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant
420421
win->property.select_start = 0;
421422
win->property.select_end = 0;
422423
win->property.active = 0;
424+
win->edit.active = nk_false;
423425
}
424426
}
425427
NK_API void

0 commit comments

Comments
 (0)