Skip to content
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

Add signal Overlay::get-child-position #613

Merged
merged 1 commit into from Jan 15, 2018

Conversation

Projects
None yet
3 participants
@EPashkin
Copy link
Member

EPashkin commented Jan 14, 2018

&from_glib_borrow(widget),
) {
Some(rect) => {
ptr::write(allocation, transmute(rect));

This comment has been minimized.

@EPashkin

EPashkin Jan 14, 2018

Author Member

Maybe write_unaligned need used instead?

This comment has been minimized.

@sdroege

sdroege Jan 15, 2018

Member

No, the rectangle destination is required to be properly aligned. It's otherwise a bug in the code that emitted the signal.

But why is the transmute necessary? Don't we have the normal translation traits implemented for Rectangle? Otherwise looks all good

This comment has been minimized.

@EPashkin

EPashkin Jan 15, 2018

Author Member

*allocation = *rect.to_glib_none().0 will fails with error[E0507]: cannot move out of dereference of raw pointer,
using dereference instead transmute will produce same error.
Currently no direct conversion to GtkRectangle other that to_glib_none.

This comment has been minimized.

@sdroege

sdroege Jan 15, 2018

Member

ptr::write(allocation, ptr::read(rect.to_glib_none().0))?

This comment has been minimized.

@EPashkin

EPashkin Jan 15, 2018

Author Member

Thanks, I missed that possibility.

ptr::write(allocation, transmute(rect));
GTRUE
}
None => GFALSE,

This comment has been minimized.

@sdroege

sdroege Jan 15, 2018

Member

Maybe want to let the match return true/false and then call .to_glib() on the overall result?

This comment has been minimized.

@EPashkin

EPashkin Jan 15, 2018

Author Member

You right, I will change this later

@EPashkin EPashkin force-pushed the EPashkin:overlay_get_child_position branch from 2427653 to 9095aba Jan 15, 2018

@EPashkin

This comment has been minimized.

Copy link
Member Author

EPashkin commented Jan 15, 2018

Updated

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Jan 15, 2018

👍

@GuillaumeGomez

This comment has been minimized.

Copy link
Member

GuillaumeGomez commented Jan 15, 2018

Good for me as well, thanks! Just waiting for CI before merging.

@GuillaumeGomez GuillaumeGomez merged commit 2e10b99 into gtk-rs:master Jan 15, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@EPashkin EPashkin deleted the EPashkin:overlay_get_child_position branch Jan 15, 2018

vhdirk pushed a commit to vhdirk/gtk-rs that referenced this pull request Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.