Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Application subclasss needs to handle parent delete_event #916

Closed
alatiera opened this issue Nov 19, 2019 · 2 comments · Fixed by #921
Closed

Application subclasss needs to handle parent delete_event #916

alatiera opened this issue Nov 19, 2019 · 2 comments · Fixed by #921

Comments

@alatiera
Copy link
Contributor

Unrelated. The problem is that delete_event is NULL here and we currently don't handle that in the subclass bindings. We would have to check for which virtual methods it is valid to have NULL there and then what the default behaviour should be (another thing for which we don't have g-i annotations...). That requires diving into the C code. I've done that for the things in gio and gstreamer, but nowhere else.

In this specific case, instead of panicking at that line it should return false here if it's NULL.

Originally posted by @sdroege in gtk-rs/examples#256 (comment)

@sdroege sdroege mentioned this issue Nov 19, 2019
43 tasks
@sdroege
Copy link
Member

sdroege commented Nov 20, 2019

The title is wrong. It's not about handling it instead of setting to NULL, but we need to handle the parent one being NULL by implementing default behaviour.

In specific, the expect() here should be replaced by an unwrap_or(false):

.expect("No parent class impl for \"delete_event\"");

@sdroege
Copy link
Member

sdroege commented Nov 21, 2019

Also CC @BrainBlasted

@alatiera alatiera changed the title Application subclasss needs to handle delete_event instead of setting it to NULL Application subclasss needs to handle parent delete_event Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants