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

Port select-frame #1384

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Port select-frame #1384

wants to merge 3 commits into from

Conversation

yshalenyk
Copy link
Contributor

No description provided.

rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
@shaleh
Copy link
Collaborator

shaleh commented Mar 14, 2019

Would you like to give porting do_switch_frame a go?

@shaleh
Copy link
Collaborator

shaleh commented Mar 14, 2019

Typically, we would port frame as a LispFrameRef. In this case, it would immediately be cast back into a LispObject to call the C function do_switch_frame. So there is little value. However, if the C function is also ported then the Rust types have more usefulness.

@yshalenyk
Copy link
Contributor Author

ok, I will try to do it.

@yshalenyk yshalenyk changed the title Port select-frame [WIP] Port select-frame Mar 15, 2019
brotzeit
brotzeit previously approved these changes Mar 25, 2019
Copy link
Member

@brotzeit brotzeit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this. You can always open another PR.

@yshalenyk
Copy link
Contributor Author

Sorry for the delay, folks. I've added an initial implementation of do_switch_frame, it's still incomplete but I think a little review would help ;)

rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
@shaleh shaleh changed the title [WIP] Port select-frame Port select-frame Apr 8, 2019
rust_src/src/frames.rs Outdated Show resolved Hide resolved
@yshalenyk
Copy link
Contributor Author

I wonder how to deal with Travis builds errors. Basically, it's complaining about unused track argument, which is not used without "window-system" feature.

@shaleh
Copy link
Collaborator

shaleh commented Apr 9, 2019

This means you do not have enough cfg protection. Which leads to track being exposed when it is not needed/used.

@agraven
Copy link
Collaborator

agraven commented Apr 13, 2019

I would recommend at least for now to just rename track to _track.

rust_src/src/frames.rs Outdated Show resolved Hide resolved
rust_src/src/frames.rs Outdated Show resolved Hide resolved
@shaleh
Copy link
Collaborator

shaleh commented Jan 10, 2020

@yshalenyk are you interested in picking this back up?

@yshalenyk
Copy link
Contributor Author

@shaleh yes, I've rebased on top of current master and tweaked code based on review comments. CI failed I will fix it this evening

Copy link
Collaborator

@agraven agraven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a gnarly one, thanks for taking a stab at it. I have a few stylistic suggestions, I have yet to properly look over the logic, but what I have looked at seems solid.

rust_src/src/frame.rs Outdated Show resolved Hide resolved
rust_src/src/frame.rs Outdated Show resolved Hide resolved
rust_src/src/frame.rs Outdated Show resolved Hide resolved
rust_src/src/frame.rs Outdated Show resolved Hide resolved
Some(f) if f.eq(&current_frame_ref) => unsafe {
Fredirect_frame_focus(xfocus, frame);
},
None if focus.is_nil()
Copy link
Collaborator

@agraven agraven Jan 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

focus.is_nil() should not* be necessary as it's implied by as_frame() returning None

*Misspelled not as now

@@ -857,96 +857,103 @@ pub extern "C" fn do_switch_frame(
// This used to check for a live frame, but apparently it's possible for
// a switch-frame event to arrive after a frame is no longer live,
// especially when deleting the initial frame during startup.
if let Some(mut target_frame) = frame.as_live_frame() {
if target_frame.eq(&current_frame_ref) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one got lost in the translation to a match statement. It could be added back my adding a

    Some(target_frame) if target_frame.eq(&current_frame_ref) => return frame,

branch to the start of the match

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants