Commit 18b198b
committed
Fix recursion panic when PopupWindow.show() called in init callback (#9498)
- Defer user_init() call using event loop in both Rust and C++ backends
- Add fallback to synchronous call when event loop unavailable
- Fixes issue where init callbacks calling popup.show() caused infinite recursion
Changes:
- internal/compiler/generator/rust.rs: Defer user_init via invoke_from_event_loop
- api/cpp/include/slint_window.h: Defer user_init via slint_post_event
- Applied to both ShowPopupWindow and ShowPopupMenu cases
This change breaks the recursion by deferring the user_init execution,
allowing the popup to be properly initialized before init callbacks run.1 parent 78386d8 commit 18b198b
File tree
2 files changed
+20
-4
lines changed- api/cpp/include
- internal/compiler/generator
2 files changed
+20
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
| 127 | + | |
| 128 | + | |
127 | 129 | | |
128 | 130 | | |
129 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2912 | 2912 | | |
2913 | 2913 | | |
2914 | 2914 | | |
2915 | | - | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
2916 | 2923 | | |
2917 | 2924 | | |
2918 | 2925 | | |
| |||
2991 | 2998 | | |
2992 | 2999 | | |
2993 | 3000 | | |
2994 | | - | |
| 3001 | + | |
| 3002 | + | |
| 3003 | + | |
| 3004 | + | |
| 3005 | + | |
| 3006 | + | |
| 3007 | + | |
| 3008 | + | |
2995 | 3009 | | |
2996 | 3010 | | |
2997 | 3011 | | |
| |||
0 commit comments