-
Notifications
You must be signed in to change notification settings - Fork 309
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
Port make-frame-visible. #1526
Port make-frame-visible. #1526
Conversation
|
rust_src/src/frames.rs
Outdated
if window.is_null() { | ||
return; | ||
} | ||
loop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a loop, let's implement an Iterator for LispWindowRef that knows how to walk the next
window attribute. Look at LispSymbolRef's iterator as an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, you are right. I made this change in my latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good start, let's lean into Rust a bit more.
I also included a fix for this in my last commit, however, I am not sure it is the best way to handle it... |
rust_src/src/frames.rs
Outdated
} | ||
} | ||
} | ||
let frame_ref: LispFrameRef = frame.into(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe if we did this at the top? Then there would not be a reason to repeat it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is that the cfg
block needs a mutable pointer in the call to x_make_window_visible
. However, when that cfg
block is not compiled, the mut
of frame_ref
is unnecessary. I have a new commit to solve this issue without calling into
multiple times.
@shaleh I guess this is ready for another review. However, I am not sure why |
Resurrected this here (#1573). |
Closing since #1573 replaces this PR |
This PR hopefully ports
make-frame-visible
to Rust. I am not includingmake-frame-invisible
into this PR as it I need to port many functions for that, making the PR too big to review. I am not sure how to create unit tests for this function.