Commit 3e2a7e3
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 3e2a7e3
File tree
2 files changed
+34
-4
lines changed- api/cpp/include
- internal/compiler/generator
2 files changed
+34
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
123 | 131 | | |
124 | 132 | | |
125 | 133 | | |
126 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
127 | 143 | | |
128 | 144 | | |
129 | 145 | | |
| |||
| 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