New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault with list filtering/deleting/selecting #1673
Comments
Backtrace of the crash
|
This is going to cause reentrancy and therefor isn't allowed. The code is triggering a selection change while the previous item change has not finished propagating to all other change handlers. |
Ok, what is the correct approach to trigger a selection change on item change? |
The absolutely best and most correct way is to write a SelectionModel that does what you want. GtkSingleSelection with does trigger a selection change on item change, just not the one you want I guess. The less involved but somewhat hacky way would be to add a new main loop source via g_idle_add or so that runs after the items-changed has finished. And the very-hacky-but-maybe-good-enough-i-hope-it-doesnt-break method would be to connect_after() to items-changed. Also, I have no idea why you want to trigger a selection-changed - do you just want set_autoselect()? |
The use case is I am writing a notes app where I want to keep the current note "selected" so long as the note list is not filtered such that it is not visible, and restore that selection when the filter is cleared such that it is visible again |
I wrote some code for a |
Bug description
This code causes a segmentation fault. I've minimised this as best I can, apologies as the snippet is still quite long.
The text was updated successfully, but these errors were encountered: