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

Hack to make X11 work #121

Closed
wants to merge 8 commits into from
Closed

Hack to make X11 work #121

wants to merge 8 commits into from

Conversation

j4qfrost
Copy link

@j4qfrost j4qfrost commented Feb 3, 2020

This is a lot less invasive than my previous pull requests. Feels like a hack though. I am checking against the OS which doesn't specifically block out X11, but seeing as how flutter uses X11 for linux, we shouldn't run into any issues.

@dvc94ch
Copy link
Member

dvc94ch commented Feb 3, 2020

I see you're still experiencing an issue, at @csnewman also ran into it. Can you explain when and why it occurs?

@dvc94ch
Copy link
Member

dvc94ch commented Feb 3, 2020

So as @csnewman suggested it looks like winit may not be generating an entered event on x11 if the window starts with the cursor already over it. The right way to fix this would be to make sure that an enter event is always generated.

@j4qfrost
Copy link
Author

j4qfrost commented Feb 3, 2020

In my case, it looked like 2 entered events were being sent or X11 was handling entered events on its own, since the states.find check indicated that the device was already stored in the device map.

@dvc94ch
Copy link
Member

dvc94ch commented Feb 3, 2020

also can you rebase and squash the changes?

git reset HEAD~8 && git add . && git commit -m "hack to make x11 work" && git fetch upstream master && git rebase upstream/master && git push origin master -f

we really need a proper fix so that we can merge it.

@csnewman
Copy link
Member

csnewman commented Feb 3, 2020

I'm not sure this is the correct approach. We should check if the device is already added, and if so, don't send an additional add.

@j4qfrost
Copy link
Author

j4qfrost commented Feb 3, 2020

I think the only way to properly check this is on the engine-side. Are either of you working on local engine build subcommands for cargo-flutter?

@csnewman
Copy link
Member

csnewman commented Feb 3, 2020

Local engine builds? We shouldn't need to patch the actual flutter engine, the logic to prevent this error should be handled in flutter-rs (in the flutter-engine crate). As it is a bug to be sending two for sure.

@dvc94ch
Copy link
Member

dvc94ch commented Feb 3, 2020

what I don't fully understand is why we are sending two entered events. is it a winit bug? but we can easily fix it on the flutter-rs side.

@csnewman
Copy link
Member

csnewman commented Feb 3, 2020

Afaik it's a winit bug

@j4qfrost
Copy link
Author

j4qfrost commented Feb 3, 2020 via email

@dvc94ch
Copy link
Member

dvc94ch commented Mar 7, 2020

Closing this for now

@dvc94ch dvc94ch closed this Mar 7, 2020
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

3 participants